changeset 1969:6fd07b903478

Merge
author lana
date Wed, 25 Nov 2009 22:14:30 -0800
parents b62c74b1772e 5f452be1691e
children e6b46fc235b0
files make/tools/fontchecker/Makefile make/tools/src/build/tools/fontchecker/FontCheckDummy.java make/tools/src/build/tools/fontchecker/FontChecker.java make/tools/src/build/tools/fontchecker/FontCheckerConstants.java make/tools/src/build/tools/fontchecker/FontFileFilter.java make/tools/src/build/tools/fontchecker/README.txt src/share/classes/com/sun/jmx/event/DaemonThreadFactory.java src/share/classes/com/sun/jmx/event/EventBuffer.java src/share/classes/com/sun/jmx/event/EventClientFactory.java src/share/classes/com/sun/jmx/event/EventConnection.java src/share/classes/com/sun/jmx/event/EventParams.java src/share/classes/com/sun/jmx/event/LeaseManager.java src/share/classes/com/sun/jmx/event/LeaseRenewer.java src/share/classes/com/sun/jmx/event/ReceiverBuffer.java src/share/classes/com/sun/jmx/event/RepeatedSingletonJob.java src/share/classes/com/sun/jmx/interceptor/DispatchInterceptor.java src/share/classes/com/sun/jmx/interceptor/DomainDispatchInterceptor.java src/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptorSupport.java src/share/classes/com/sun/jmx/interceptor/NamespaceDispatchInterceptor.java src/share/classes/com/sun/jmx/interceptor/SingleMBeanForwarder.java src/share/classes/com/sun/jmx/mbeanserver/MBeanInjector.java src/share/classes/com/sun/jmx/mbeanserver/NotificationMBeanSupport.java src/share/classes/com/sun/jmx/mbeanserver/NotifySupport.java src/share/classes/com/sun/jmx/mbeanserver/PerThreadGroupPool.java src/share/classes/com/sun/jmx/namespace/DomainInterceptor.java src/share/classes/com/sun/jmx/namespace/HandlerInterceptor.java src/share/classes/com/sun/jmx/namespace/NamespaceInterceptor.java src/share/classes/com/sun/jmx/namespace/ObjectNameRouter.java src/share/classes/com/sun/jmx/namespace/RoutingConnectionProxy.java src/share/classes/com/sun/jmx/namespace/RoutingMBeanServerConnection.java src/share/classes/com/sun/jmx/namespace/RoutingProxy.java src/share/classes/com/sun/jmx/namespace/RoutingServerProxy.java src/share/classes/com/sun/jmx/namespace/package.html src/share/classes/com/sun/jmx/namespace/serial/DefaultRewritingProcessor.java src/share/classes/com/sun/jmx/namespace/serial/IdentityProcessor.java src/share/classes/com/sun/jmx/namespace/serial/JMXNamespaceContext.java src/share/classes/com/sun/jmx/namespace/serial/RewritingProcessor.java src/share/classes/com/sun/jmx/namespace/serial/RoutingOnlyProcessor.java src/share/classes/com/sun/jmx/namespace/serial/SerialRewritingProcessor.java src/share/classes/com/sun/jmx/namespace/serial/package.html src/share/classes/com/sun/jmx/remote/internal/ProxyInputStream.java src/share/classes/com/sun/jmx/remote/util/EventClientConnection.java src/share/classes/java/nio/ByteBufferAs-X-Buffer.java src/share/classes/java/nio/Direct-X-Buffer-bin.java src/share/classes/java/nio/Direct-X-Buffer.java src/share/classes/java/nio/Heap-X-Buffer.java src/share/classes/java/nio/X-Buffer-bin.java src/share/classes/java/nio/X-Buffer.java src/share/classes/java/nio/charset/Charset-X-Coder.java src/share/classes/javax/management/ClientContext.java src/share/classes/javax/management/Description.java src/share/classes/javax/management/DescriptorFields.java src/share/classes/javax/management/DynamicWrapperMBean.java src/share/classes/javax/management/GenericMBeanException.java src/share/classes/javax/management/Impact.java src/share/classes/javax/management/MBean.java src/share/classes/javax/management/ManagedAttribute.java src/share/classes/javax/management/ManagedOperation.java src/share/classes/javax/management/NotificationInfo.java src/share/classes/javax/management/NotificationInfos.java src/share/classes/javax/management/ObjectNameTemplate.java src/share/classes/javax/management/QueryNotificationFilter.java src/share/classes/javax/management/QueryParser.java src/share/classes/javax/management/SendNotification.java src/share/classes/javax/management/event/EventClient.java src/share/classes/javax/management/event/EventClientDelegate.java src/share/classes/javax/management/event/EventClientDelegateMBean.java src/share/classes/javax/management/event/EventClientNotFoundException.java src/share/classes/javax/management/event/EventConsumer.java src/share/classes/javax/management/event/EventForwarder.java src/share/classes/javax/management/event/EventReceiver.java src/share/classes/javax/management/event/EventRelay.java src/share/classes/javax/management/event/EventSubscriber.java src/share/classes/javax/management/event/FetchingEventForwarder.java src/share/classes/javax/management/event/FetchingEventRelay.java src/share/classes/javax/management/event/ListenerInfo.java src/share/classes/javax/management/event/NotificationManager.java src/share/classes/javax/management/event/RMIPushEventForwarder.java src/share/classes/javax/management/event/RMIPushEventRelay.java src/share/classes/javax/management/event/RMIPushServer.java src/share/classes/javax/management/event/package-info.java src/share/classes/javax/management/namespace/JMXDomain.java src/share/classes/javax/management/namespace/JMXNamespace.java src/share/classes/javax/management/namespace/JMXNamespaceMBean.java src/share/classes/javax/management/namespace/JMXNamespacePermission.java src/share/classes/javax/management/namespace/JMXNamespaceView.java src/share/classes/javax/management/namespace/JMXNamespaces.java src/share/classes/javax/management/namespace/JMXRemoteNamespace.java src/share/classes/javax/management/namespace/JMXRemoteNamespaceMBean.java src/share/classes/javax/management/namespace/MBeanServerConnectionWrapper.java src/share/classes/javax/management/namespace/MBeanServerSupport.java src/share/classes/javax/management/namespace/VirtualEventManager.java src/share/classes/javax/management/namespace/package-info.java src/share/classes/javax/management/openmbean/MXBeanMapping.java src/share/classes/javax/management/openmbean/MXBeanMappingClass.java src/share/classes/javax/management/openmbean/MXBeanMappingFactory.java src/share/classes/javax/management/openmbean/MXBeanMappingFactoryClass.java src/share/classes/javax/management/remote/IdentityMBeanServerForwarder.java src/share/classes/sun/misc/Version-template.java src/share/classes/sun/net/www/protocol/http/HttpLogFormatter.java src/share/classes/sun/net/www/protocol/http/NegotiateCallbackHandler.java src/share/classes/sun/net/www/protocol/http/NegotiatorImpl.java src/share/classes/sun/security/provider/certpath/LDAPCertStore.java src/share/classes/sun/security/ssl/KerberosPreMasterSecret.java src/share/classes/sun/tools/jconsole/Version-template.java src/solaris/classes/sun/awt/X11/XWindowPeer.java src/windows/classes/sun/net/www/protocol/http/NTLMAuthSequence.java src/windows/classes/sun/net/www/protocol/http/NTLMAuthentication.java src/windows/native/sun/net/www/protocol/http/NTLMAuthSequence.c test/java/nio/Buffer/Basic-X.java test/java/nio/Buffer/CopyDirect-X-Memory.java test/javax/management/Introspector/AnnotatedMBeanTest.java test/javax/management/Introspector/AnnotatedNotificationInfoTest.java test/javax/management/Introspector/ExceptionsDescriptorTest.java test/javax/management/Introspector/MBeanDescriptionTest.java test/javax/management/Introspector/ObjectNameTemplateTest.java test/javax/management/Introspector/ParameterNameTest.java test/javax/management/Introspector/ResourceInjectionTest.java test/javax/management/MBeanServer/AttributeListMapTest.java test/javax/management/MBeanServer/DynamicWrapperMBeanTest.java test/javax/management/MBeanServer/InstanceNotFoundExceptionTest.java test/javax/management/MBeanServerFactory/NamedMBeanServerTest.java test/javax/management/ObjectName/ValueOfTest.java test/javax/management/context/ContextForwarderTest.java test/javax/management/context/ContextTest.java test/javax/management/context/LocaleAwareBroadcasterTest.java test/javax/management/context/LocaleTest.java test/javax/management/context/LocalizableTest.java test/javax/management/context/RemoteContextTest.java test/javax/management/context/localizable/MBeanDescriptions.properties test/javax/management/context/localizable/MBeanDescriptions_fr.java test/javax/management/context/localizable/Whatsit.java test/javax/management/context/localizable/WhatsitMBean.java test/javax/management/descriptor/DescriptorConstructorTest.java test/javax/management/eventService/AddRemoveListenerTest.java test/javax/management/eventService/CustomForwarderTest.java test/javax/management/eventService/EventClientExecutorTest.java test/javax/management/eventService/EventClientThreadTest.java test/javax/management/eventService/EventDelegateSecurityTest.java test/javax/management/eventService/EventManagerTest.java test/javax/management/eventService/FetchingTest.java test/javax/management/eventService/LeaseManagerDeadlockTest.java test/javax/management/eventService/LeaseTest.java test/javax/management/eventService/ListenerTest.java test/javax/management/eventService/MyFetchingEventForwarder.java test/javax/management/eventService/NotSerializableNotifTest.java test/javax/management/eventService/PublishTest.java test/javax/management/eventService/ReconnectableConnectorTest.java test/javax/management/eventService/SharingThreadTest.java test/javax/management/eventService/SubUnsubTest.java test/javax/management/eventService/SubscribeTest.java test/javax/management/eventService/UsingEventService.java test/javax/management/interop/MBeanExceptionInteropTest.java test/javax/management/modelmbean/DefaultDescriptorFieldTest.java test/javax/management/monitor/InstantiateMonitorNotificationTest.java test/javax/management/mxbean/CustomTypeTest.java test/javax/management/mxbean/JMXServiceURLTest.java test/javax/management/mxbean/customtypes/CustomLongMXBean.java test/javax/management/mxbean/customtypes/CustomMXBean.java test/javax/management/mxbean/customtypes/IntegerIsLongFactory.java test/javax/management/mxbean/customtypes/IntegerIsStringFactory.java test/javax/management/mxbean/customtypes/package-info.java test/javax/management/namespace/DomainCreationTest.java test/javax/management/namespace/EventWithNamespaceControlTest.java test/javax/management/namespace/EventWithNamespaceTest.java test/javax/management/namespace/ExportNamespaceTest.java test/javax/management/namespace/JMXDomainTest.java test/javax/management/namespace/JMXNamespaceSecurityTest.java test/javax/management/namespace/JMXNamespaceTest.java test/javax/management/namespace/JMXNamespaceViewTest.java test/javax/management/namespace/JMXNamespacesTest.java test/javax/management/namespace/JMXRemoteNamespaceTest.java test/javax/management/namespace/JMXRemoteTargetNamespace.java test/javax/management/namespace/LazyDomainTest.java test/javax/management/namespace/LeadingSeparatorsTest.java test/javax/management/namespace/MXBeanRefTest.java test/javax/management/namespace/NamespaceController.java test/javax/management/namespace/NamespaceControllerMBean.java test/javax/management/namespace/NamespaceCreationTest.java test/javax/management/namespace/NamespaceNotificationsTest.java test/javax/management/namespace/NullDomainObjectNameTest.java test/javax/management/namespace/NullObjectNameTest.java test/javax/management/namespace/QueryNamesTest.java test/javax/management/namespace/RemoveNotificationListenerTest.java test/javax/management/namespace/RoutingServerProxyTest.java test/javax/management/namespace/SerialParamProcessorTest.java test/javax/management/namespace/SourceNamespaceTest.java test/javax/management/namespace/VirtualMBeanNotifTest.java test/javax/management/namespace/VirtualMBeanTest.java test/javax/management/namespace/VirtualNamespaceQueryTest.java test/javax/management/namespace/VirtualPropsTest.java test/javax/management/namespace/Wombat.java test/javax/management/namespace/WombatMBean.java test/javax/management/namespace/namespace.policy test/javax/management/notification/SupportClearTest.java test/javax/management/openmbean/CompositeDataToMapTest.java test/javax/management/openmbean/GenericMBeanExceptionTest.java test/javax/management/query/QueryDottedAttrTest.java test/javax/management/query/QueryNotifFilterTest.java test/javax/management/query/QueryParseTest.java test/javax/management/remote/mandatory/connectorServer/CloseConnectionTest.java test/javax/management/remote/mandatory/connectorServer/ForwarderChainTest.java test/javax/management/remote/mandatory/connectorServer/StandardForwardersTest.java test/javax/management/remote/mandatory/version/JMXSpecVersionTest.java test/javax/management/standardmbean/FindMethodTest.java test/javax/management/standardmbean/RegistrationTest.java
diffstat 725 files changed, 41315 insertions(+), 71039 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Nov 25 21:27:06 2009 +0300
+++ b/.hgtags	Wed Nov 25 22:14:30 2009 -0800
@@ -48,3 +48,6 @@
 b3f3240135f0c10b9f2481c174b81b7fcf0daa60 jdk7-b71
 460639b036f327282832a4fe52b7aa45688afd50 jdk7-b72
 f708138c9aca4b389872838fe6773872fce3609e jdk7-b73
+eacb36e30327e7ae33baa068e82ddccbd91eaae2 jdk7-b74
+8885b22565077236a927e824ef450742e434a230 jdk7-b75
+8fb602395be0f7d5af4e7e93b7df2d960faf9d17 jdk7-b76
--- a/make/common/Defs-linux.gmk	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/common/Defs-linux.gmk	Wed Nov 25 22:14:30 2009 -0800
@@ -116,8 +116,16 @@
 LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
 CFLAGS_REQUIRED_sparc   += -m32 -mcpu=v9
 LDFLAGS_COMMON_sparc    += -m32 -mcpu=v9
-CFLAGS_REQUIRED         =  $(CFLAGS_REQUIRED_$(ARCH))
-LDFLAGS_COMMON          += $(LDFLAGS_COMMON_$(ARCH))
+ifeq ($(ZERO_BUILD), true)
+  CFLAGS_REQUIRED       =  $(ZERO_ARCHFLAG)
+  ifeq ($(ZERO_ENDIANNESS), little)
+    CFLAGS_REQUIRED     += -D_LITTLE_ENDIAN
+  endif
+  LDFLAGS_COMMON        += $(ZERO_ARCHFLAG)
+else
+  CFLAGS_REQUIRED       =  $(CFLAGS_REQUIRED_$(ARCH))
+  LDFLAGS_COMMON        += $(LDFLAGS_COMMON_$(ARCH))
+endif
 
 # If this is a --hash-style=gnu system, use --hash-style=both
 #   The gnu .hash section won't work on some Linux systems like SuSE 10.
@@ -217,7 +225,7 @@
 
 EXTRA_LIBS += -lc
 
-LDFLAGS_DEFS_OPTION  = -z defs
+LDFLAGS_DEFS_OPTION  = -Xlinker -z -Xlinker defs
 LDFLAGS_COMMON  += $(LDFLAGS_DEFS_OPTION)
 
 #
--- a/make/common/Defs.gmk	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/common/Defs.gmk	Wed Nov 25 22:14:30 2009 -0800
@@ -667,12 +667,7 @@
 LINTFLAGS       = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \
 		  $(OTHER_LINTFLAGS)
 
-# this should be moved into Defs-<platform>.gmk.....
-ifeq ($(PLATFORM), windows)
-  VERSION_DEFINES = -DRELEASE="\"$(RELEASE)\""
-else
-  VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
-endif
+VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
 
 # Note: As a rule, GNU Make rules should not appear in any of the 
 # Defs*.gmk files. These were added for Kestrel-Solaris and do address
--- a/make/common/Program.gmk	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/common/Program.gmk	Wed Nov 25 22:14:30 2009 -0800
@@ -85,7 +85,7 @@
 	endif
     endif
     ifeq ($(PLATFORM), linux)
-	LDFLAGS += -z origin
+	LDFLAGS += -Wl,-z -Wl,origin
 	LDFLAGS += -Wl,--allow-shlib-undefined
 	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
 	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli
@@ -236,13 +236,13 @@
 endif # INCREMENTAL_BUILD
 
 ifdef JAVA_ARGS
-OTHER_CPPFLAGS += -DJAVA_ARGS=$(JAVA_ARGS)
-OTHER_CPPFLAGS += -DLAUNCHER_NAME=\"$(LAUNCHER_NAME)\"
+OTHER_CPPFLAGS += -DJAVA_ARGS='$(JAVA_ARGS)'
+OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"'
 endif
 
 ifeq ($(PLATFORM), windows)
 ifdef RELEASE
-OTHER_CPPFLAGS += -DVERSION="$(RELEASE)"
+OTHER_CPPFLAGS += -DVERSION='"$(RELEASE)"'
 endif
 endif
 
@@ -258,14 +258,8 @@
 OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
 OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
 
-# this may not be necessary...
-ifeq ($(PLATFORM), windows)
-OTHER_CPPFLAGS += -DPROGNAME="\"$(PROGRAM)\""
-VERSION_DEFINES += -DFULL_VERSION="\"$(FULL_VERSION)\""
-else
 OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"'
 VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
-endif
 
 VERSION_DEFINES += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
 		   -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"'
@@ -279,8 +273,14 @@
 
 #
 # How to install jvm.cfg. 
-# 
-$(JVMCFG): $(LAUNCHER_PLATFORM_SRC)/bin/$(ARCH)/jvm.cfg 
+#
+ifeq ($(ZERO_BUILD), true)
+JVMCFG_ARCH = zero
+else
+JVMCFG_ARCH = $(ARCH)
+endif
+
+$(JVMCFG): $(LAUNCHER_PLATFORM_SRC)/bin/$(JVMCFG_ARCH)/jvm.cfg 
 	$(install-file)
 
 #
--- a/make/common/Release.gmk	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/common/Release.gmk	Wed Nov 25 22:14:30 2009 -0800
@@ -330,7 +330,7 @@
 #
 # Specific files and directories that will be filtered out from above areas.
 #
-SOURCE_FILTERs = $(SCM_DIRs) 'X-*' '*-X-*' '*-template.java' ',*'
+SOURCE_FILTERs = $(SCM_DIRs) ',*'
 SOURCE_FILES_filter = $(SOURCE_FILTERs:%=-name % -prune -o)
 
 #
--- a/make/common/Rules.gmk	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/common/Rules.gmk	Wed Nov 25 22:14:30 2009 -0800
@@ -63,7 +63,7 @@
 # If AUTO_FILES_PROPERTIES_DIRS used, automatically find properties files
 #
 ifdef AUTO_FILES_PROPERTIES_DIRS
-  AUTO_FILES_PROPERTIES_FILTERS1  = $(SCM_DIRs) 'X-*' '*-X-*' ',*'
+  AUTO_FILES_PROPERTIES_FILTERS1  = $(SCM_DIRs) ',*'
   AUTO_FILES_PROPERTIES_FILTERS1 += $(AUTO_PROPERTIES_PRUNE)
   FILES_properties_find_filters1 = $(AUTO_FILES_PROPERTIES_FILTERS1:%=-name % -prune -o)
   FILES_properties_auto1 := \
@@ -111,7 +111,7 @@
 
 ifdef AUTO_FILES_JAVA_DIRS
   # Filter out these files or directories
-  AUTO_FILES_JAVA_SOURCE_FILTERS1  = $(SCM_DIRs) 'X-*' '*-X-*' '*-template.java' ',*'
+  AUTO_FILES_JAVA_SOURCE_FILTERS1  = $(SCM_DIRs) ',*'
   AUTO_FILES_JAVA_SOURCE_FILTERS2  = 
   AUTO_FILES_JAVA_SOURCE_FILTERS1 += $(AUTO_JAVA_PRUNE)
   AUTO_FILES_JAVA_SOURCE_FILTERS2 += $(AUTO_JAVA_PRUNE)
--- a/make/common/shared/Defs-java.gmk	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/common/shared/Defs-java.gmk	Wed Nov 25 22:14:30 2009 -0800
@@ -165,11 +165,6 @@
   JAVADOC_CMD   = $(JAVA_TOOLS_DIR)/javadoc $(JAVA_TOOLS_FLAGS:%=-J%)
 endif
 
-#always use the bootstrap javah until bug-ID 6889255 is fixed.  These
-#five lines should be removed as part of that fix:
-JAVAH_CMD     = $(JAVA_TOOLS_DIR)/javah \
-		  $(JAVAHFLAGS)
-
 # Override of what javac to use (see deploy workspace)
 ifdef JAVAC
   JAVAC_CMD     = $(JAVAC)
--- a/make/docs/CORE_PKGS.gmk	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/docs/CORE_PKGS.gmk	Wed Nov 25 22:14:30 2009 -0800
@@ -160,10 +160,8 @@
   javax.lang.model.type                          \
   javax.lang.model.util                          \
   javax.management                               \
-  javax.management.event                         \
   javax.management.loading                       \
   javax.management.monitor                       \
-  javax.management.namespace                     \
   javax.management.relation                      \
   javax.management.openmbean                     \
   javax.management.timer                         \
--- a/make/java/instrument/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/java/instrument/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -109,7 +109,7 @@
     LDFLAGS += -R \$$ORIGIN/jli
   endif
   ifeq ($(PLATFORM), linux)
-    LDFLAGS += -z origin
+    LDFLAGS += -Wl,-z -Wl,origin
     LDFLAGS += -Wl,--allow-shlib-undefined
     LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/jli
   endif
--- a/make/java/java/FILES_java.gmk	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/java/java/FILES_java.gmk	Wed Nov 25 22:14:30 2009 -0800
@@ -251,6 +251,7 @@
 	java/util/IdentityHashMap.java \
 	java/util/EnumMap.java \
     java/util/Arrays.java \
+    java/util/DualPivotQuicksort.java \
     java/util/TimSort.java \
     java/util/ComparableTimSort.java \
     java/util/ConcurrentModificationException.java \
@@ -258,6 +259,7 @@
     java/util/ServiceConfigurationError.java \
     java/util/Timer.java \
     java/util/TimerTask.java \
+    java/util/Objects.java \
     java/util/UUID.java \
     java/util/concurrent/AbstractExecutorService.java \
     java/util/concurrent/ArrayBlockingQueue.java \
@@ -285,11 +287,18 @@
     java/util/concurrent/ExecutorService.java \
     java/util/concurrent/ExecutorCompletionService.java \
     java/util/concurrent/Executors.java \
+    java/util/concurrent/ForkJoinPool.java \
+    java/util/concurrent/ForkJoinTask.java \
+    java/util/concurrent/ForkJoinWorkerThread.java \
     java/util/concurrent/Future.java \
     java/util/concurrent/FutureTask.java \
     java/util/concurrent/LinkedBlockingDeque.java \
     java/util/concurrent/LinkedBlockingQueue.java \
+    java/util/concurrent/LinkedTransferQueue.java \
+    java/util/concurrent/Phaser.java \
     java/util/concurrent/PriorityBlockingQueue.java \
+    java/util/concurrent/RecursiveAction.java \
+    java/util/concurrent/RecursiveTask.java \
     java/util/concurrent/RejectedExecutionException.java \
     java/util/concurrent/RejectedExecutionHandler.java \
     java/util/concurrent/RunnableFuture.java \
@@ -300,9 +309,11 @@
     java/util/concurrent/Semaphore.java \
     java/util/concurrent/SynchronousQueue.java \
     java/util/concurrent/ThreadFactory.java \
+    java/util/concurrent/ThreadLocalRandom.java \
     java/util/concurrent/ThreadPoolExecutor.java \
     java/util/concurrent/TimeUnit.java \
     java/util/concurrent/TimeoutException.java \
+    java/util/concurrent/TransferQueue.java \
     java/util/concurrent/atomic/AtomicBoolean.java \
     java/util/concurrent/atomic/AtomicInteger.java \
     java/util/concurrent/atomic/AtomicIntegerArray.java \
--- a/make/java/jli/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/java/jli/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -48,11 +48,15 @@
 LAUNCHER_SHARE_SRC = $(SHARE_SRC)/bin
 LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)/bin
 
+ifeq ($(ZERO_BUILD), true)
+ERGO_FAMILY=zero
+else
 ifeq ($(ARCH_FAMILY), amd64)
 ERGO_FAMILY=i586
 else
 ERGO_FAMILY=$(ARCH_FAMILY)
 endif
+endif
 
 
 #
--- a/make/java/main/java/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/java/main/java/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -57,7 +57,7 @@
 #
 include $(BUILDDIR)/common/Program.gmk
 OTHER_CPPFLAGS += -DEXPAND_CLASSPATH_WILDCARDS
-OTHER_CPPFLAGS += -DLAUNCHER_NAME=\"$(LAUNCHER_NAME)\"
+OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"'
 
 ifeq ($(PLATFORM), solaris)
 LDFLAGS += -R$(OPENWIN_LIB)
--- a/make/java/main/javaw/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/java/main/javaw/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -62,4 +62,5 @@
 #
 include $(BUILDDIR)/common/Program.gmk
 OTHER_CPPFLAGS += -DEXPAND_CLASSPATH_WILDCARDS
-OTHER_CPPFLAGS += -DLAUNCHER_NAME=\"$(LAUNCHER_NAME)\"
+OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"'
+
--- a/make/java/net/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/java/net/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -83,7 +83,7 @@
 #
 # Find platform specific native code
 #
-vpath %.c $(PLATFORM_SRC)/native/sun/net/dns $(PLATFORM_SRC)/native/sun/net/www/protocol/http $(PLATFORM_SRC)/native/sun/net/spi
+vpath %.c $(PLATFORM_SRC)/native/sun/net/dns $(PLATFORM_SRC)/native/sun/net/www/protocol/http/ntlm $(PLATFORM_SRC)/native/sun/net/spi
 
 #
 # Include rules
--- a/make/java/nio/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/java/nio/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -335,6 +335,15 @@
 SCS_SRC=$(SNIO_SRC)/cs
 SFS_SRC=$(SNIO_SRC)/fs
 
+# Template files
+HEAP_X_BUF_TEMPLATE=$(BUF_SRC)/Heap-X-Buffer.java.template
+BYTE_X_BUF_TEMPLATE=$(BUF_SRC)/ByteBufferAs-X-Buffer.java.template
+X_BUF_TEMPLATE=$(BUF_SRC)/X-Buffer.java.template
+X_BUF_BIN_TEMPLATE=$(BUF_SRC)/X-Buffer-bin.java.template
+DIRECT_X_BUF_TEMPLATE=$(BUF_SRC)/Direct-X-Buffer.java.template
+DIRECT_X_BUF_BIN_TEMPLATE=$(BUF_SRC)/Direct-X-Buffer-bin.java.template
+CHARSET_X_CODER_TEMPLATE=$(CS_SRC)/Charset-X-Coder.java.template
+
 BUF_GEN=$(NIO_GEN)
 CH_GEN=$(NIO_GEN)/channels
 CS_GEN=$(NIO_GEN)/charset
@@ -357,39 +366,39 @@
 
 # Public abstract buffer classes
 #
-$(BUF_GEN)/ByteBuffer.java: $(BUF_SRC)/X-Buffer.java \
-			    $(BUF_SRC)/X-Buffer-bin.java \
+$(BUF_GEN)/ByteBuffer.java: $(X_BUF_TEMPLATE) \
+			    $(X_BUF_BIN_TEMPLATE) \
 			    $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=byte BIN=1 SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/CharBuffer.java: $(BUF_SRC)/X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/CharBuffer.java: $(X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=char SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ShortBuffer.java: $(BUF_SRC)/X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ShortBuffer.java: $(X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=short SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/IntBuffer.java: $(BUF_SRC)/X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/IntBuffer.java: $(X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=int SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/LongBuffer.java: $(BUF_SRC)/X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/LongBuffer.java: $(X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=long SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/FloatBuffer.java: $(BUF_SRC)/X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/FloatBuffer.java: $(X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=float SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DoubleBuffer.java: $(BUF_SRC)/X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DoubleBuffer.java: $(X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=double SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
@@ -397,72 +406,72 @@
 
 # Buffers whose contents are heap-allocated
 # 
-$(BUF_GEN)/HeapByteBuffer.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapByteBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=byte SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapByteBuffer%.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapByteBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=byte RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapCharBuffer.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapCharBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=char SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapCharBuffer%.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapCharBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=char RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapShortBuffer.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapShortBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=short SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapShortBuffer%.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapShortBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=short RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapIntBuffer.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapIntBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=int SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapIntBuffer%.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapIntBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=int RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapLongBuffer.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapLongBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=long SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapLongBuffer%.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapLongBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=long RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapFloatBuffer.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapFloatBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=float SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapFloatBuffer%.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapFloatBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=float RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapDoubleBuffer.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapDoubleBuffer.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=double SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/HeapDoubleBuffer%.java: $(BUF_SRC)/Heap-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/HeapDoubleBuffer%.java: $(HEAP_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=double RW=$* SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
@@ -470,15 +479,15 @@
 
 # Direct byte buffer
 # 
-$(BUF_GEN)/DirectByteBuffer.java: $(BUF_SRC)/Direct-X-Buffer.java \
-				  $(BUF_SRC)/Direct-X-Buffer.java \
+$(BUF_GEN)/DirectByteBuffer.java: $(DIRECT_X_BUF_TEMPLATE) \
+				  $(DIRECT_X_BUF_TEMPLATE) \
 				  $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=byte BIN=1 SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectByteBuffer%.java: $(BUF_SRC)/Direct-X-Buffer.java \
-				   $(BUF_SRC)/Direct-X-Buffer.java \
+$(BUF_GEN)/DirectByteBuffer%.java: $(DIRECT_X_BUF_TEMPLATE) \
+				   $(DIRECT_X_BUF_TEMPLATE) \
 				   $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
@@ -487,62 +496,62 @@
 
 # Unswapped views of direct byte buffers
 #
-$(BUF_GEN)/DirectCharBufferU.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectCharBufferU.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=char BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectCharBuffer%U.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectCharBuffer%U.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=char RW=$* BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectShortBufferU.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectShortBufferU.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=short BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectShortBuffer%U.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectShortBuffer%U.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=short RW=$* BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectIntBufferU.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectIntBufferU.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=int BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectIntBuffer%U.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectIntBuffer%U.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=int RW=$* BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectLongBufferU.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectLongBufferU.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=long BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectLongBuffer%U.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectLongBuffer%U.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=long RW=$* BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectFloatBufferU.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectFloatBufferU.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=float BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectFloatBuffer%U.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectFloatBuffer%U.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=float RW=$* BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectDoubleBufferU.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectDoubleBufferU.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=double BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectDoubleBuffer%U.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectDoubleBuffer%U.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=double RW=$* BO=U SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
@@ -550,62 +559,62 @@
 
 # Swapped views of direct byte buffers
 #
-$(BUF_GEN)/DirectCharBufferS.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectCharBufferS.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=char BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectCharBuffer%S.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectCharBuffer%S.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=char RW=$* BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectShortBufferS.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectShortBufferS.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=short BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectShortBuffer%S.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectShortBuffer%S.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=short RW=$* BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectIntBufferS.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectIntBufferS.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=int BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectIntBuffer%S.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectIntBuffer%S.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=int RW=$* BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectLongBufferS.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectLongBufferS.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=long BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectLongBuffer%S.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectLongBuffer%S.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=long RW=$* BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectFloatBufferS.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectFloatBufferS.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=float BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectFloatBuffer%S.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectFloatBuffer%S.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=float RW=$* BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectDoubleBufferS.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectDoubleBufferS.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=double BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/DirectDoubleBuffer%S.java: $(BUF_SRC)/Direct-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/DirectDoubleBuffer%S.java: $(DIRECT_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=double RW=$* BO=S SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
@@ -613,62 +622,62 @@
 
 # Big-endian views of byte buffers
 #
-$(BUF_GEN)/ByteBufferAsCharBufferB.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsCharBufferB.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=char BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsCharBuffer%B.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsCharBuffer%B.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=char RW=$* BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsShortBufferB.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsShortBufferB.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=short BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsShortBuffer%B.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsShortBuffer%B.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=short RW=$* BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsIntBufferB.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsIntBufferB.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=int BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsIntBuffer%B.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsIntBuffer%B.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=int RW=$* BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsLongBufferB.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsLongBufferB.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=long BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsLongBuffer%B.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsLongBuffer%B.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=long RW=$* BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsFloatBufferB.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsFloatBufferB.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=float BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsFloatBuffer%B.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsFloatBuffer%B.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=float RW=$* BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsDoubleBufferB.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsDoubleBufferB.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=double BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsDoubleBuffer%B.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsDoubleBuffer%B.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=double RW=$* BO=B SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
@@ -676,62 +685,62 @@
 
 # Little-endian views of byte buffers
 #
-$(BUF_GEN)/ByteBufferAsCharBufferL.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsCharBufferL.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=char BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsCharBuffer%L.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsCharBuffer%L.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=char RW=$* BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsShortBufferL.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsShortBufferL.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=short BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsShortBuffer%L.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsShortBuffer%L.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=short RW=$* BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsIntBufferL.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsIntBufferL.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=int BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsIntBuffer%L.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsIntBuffer%L.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=int RW=$* BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsLongBufferL.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsLongBufferL.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=long BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsLongBuffer%L.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsLongBuffer%L.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=long RW=$* BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsFloatBufferL.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsFloatBufferL.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=float BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsFloatBuffer%L.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsFloatBuffer%L.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=float RW=$* BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsDoubleBufferL.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsDoubleBufferL.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=double BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
 	$(MV) $@.temp $@
-$(BUF_GEN)/ByteBufferAsDoubleBuffer%L.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.java $(GEN_BUFFER_SH)
+$(BUF_GEN)/ByteBufferAsDoubleBuffer%L.java: $(BYTE_X_BUF_TEMPLATE) $(GEN_BUFFER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	TYPE=double RW=$* BO=L SRC=$< DST=$@.temp $(GEN_BUFFER_CMD)
@@ -745,13 +754,13 @@
 
 GEN_CODER_CMD = SPP="$(SPP_CMD)" SED="$(SED)" NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GEN_CODER_SH)
 
-$(CS_GEN)/CharsetDecoder.java: $(CS_SRC)/Charset-X-Coder.java $(GEN_CODER_SH)
+$(CS_GEN)/CharsetDecoder.java: $(CHARSET_X_CODER_TEMPLATE) $(GEN_CODER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	$(GEN_CODER_CMD) decoder $< $@.temp
 	$(MV) $@.temp $@
 
-$(CS_GEN)/CharsetEncoder.java: $(CS_SRC)/Charset-X-Coder.java $(GEN_CODER_SH)
+$(CS_GEN)/CharsetEncoder.java: $(CHARSET_X_CODER_TEMPLATE) $(GEN_CODER_SH)
 	$(prep-target)
 	@$(RM) $@.temp
 	$(GEN_CODER_CMD) encoder $< $@.temp
--- a/make/java/nio/genBuffer.sh	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/java/nio/genBuffer.sh	Wed Nov 25 22:14:30 2009 -0800
@@ -154,7 +154,7 @@
   mv $DST $DST.tmp
   sed -e '/#BIN/,$d' <$DST.tmp >$DST
   rm -f $DST.tmp
-  binops=`dirname $SRC`/`basename $SRC .java`-bin.java
+  binops=`dirname $SRC`/`basename $SRC .java.template`-bin.java.template
   genBinOps char character 1 two one $binops >>$DST
   genBinOps short short 1 two one $binops >>$DST
   genBinOps int integer 2 four three $binops >>$DST
--- a/make/java/redist/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/java/redist/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -94,11 +94,13 @@
   endif
 endif # INCLUDE_SA
 
-# Hotspot client is only available on 32-bit builds
+# Hotspot client is only available on 32-bit non-Zero builds
+ifneq ($(ZERO_BUILD), true)
 ifeq ($(ARCH_DATA_MODEL), 32)
   IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME) \
                  $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt
 endif
+endif
 
 ifeq ($(PLATFORM), windows)
 #  Windows     vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  Windows
@@ -171,6 +173,7 @@
   IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME)
 endif 
 
+ifneq ($(ZERO_BUILD), true)
 ifeq ($(ARCH_DATA_MODEL), 32)
 
 IMPORT_LIST += $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME)
@@ -201,6 +204,8 @@
 
 endif # 32bit
 
+endif # ZERO_BUILD
+
 #  NOT Windows ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NOT Windows
 
 endif # PLATFORM
@@ -211,7 +216,7 @@
 $(LIB_LOCATION)/$(KERNEL_LOCATION)/$(JVM_NAME): $(HOTSPOT_KERNEL_PATH)/$(JVM_NAME)
 	$(install-file)
 
-$(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_SERVER_PATH)/$(LIBJSIG_NAME)
+$(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_NAME)
 	$(install-import-file)
 
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME) \
--- a/make/java/version/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/java/version/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -33,7 +33,7 @@
 all build: $(GENSRCDIR)/sun/misc/Version.java
 
 $(GENSRCDIR)/sun/misc/Version.java: \
-		$(SHARE_SRC)/classes/sun/misc/Version-template.java
+		$(SHARE_SRC)/classes/sun/misc/Version.java.template
 	$(prep-target)
 	$(RM) $@.temp
 	$(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \
--- a/make/javax/sound/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/javax/sound/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -128,7 +128,7 @@
 
 # for dynamic inclusion of extra sound libs: these
 # JNI libs will be loaded from Platform.java
-CPPFLAGS += -DEXTRA_SOUND_JNI_LIBS="\"$(EXTRA_SOUND_JNI_LIBS)\""
+CPPFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
 
 # integrate MIDI i/o in jsound lib
 ifeq ($(INCLUDE_MIDI),TRUE)
--- a/make/javax/sound/SoundDefs.gmk	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/javax/sound/SoundDefs.gmk	Wed Nov 25 22:14:30 2009 -0800
@@ -55,21 +55,25 @@
 
 endif # PLATFORM solaris
 
-ifeq ($(ARCH), i586)
-  CPPFLAGS += -DX_ARCH=X_I586
-endif # ARCH i586
+ifeq ($(ZERO_BUILD), true)
+  CPPFLAGS += -DX_ARCH=X_ZERO
+else
+  ifeq ($(ARCH), i586)
+    CPPFLAGS += -DX_ARCH=X_I586
+  endif # ARCH i586
 
-ifeq ($(ARCH), sparc)
-  CPPFLAGS += -DX_ARCH=X_SPARC
-endif # ARCH sparc
+  ifeq ($(ARCH), sparc)
+    CPPFLAGS += -DX_ARCH=X_SPARC
+  endif # ARCH sparc
 
-ifeq ($(ARCH), sparcv9)
-  CPPFLAGS += -DX_ARCH=X_SPARCV9
-endif # ARCH sparcv9
+  ifeq ($(ARCH), sparcv9)
+    CPPFLAGS += -DX_ARCH=X_SPARCV9
+  endif # ARCH sparcv9
 
-ifeq ($(ARCH), amd64)
-  CPPFLAGS += -DX_ARCH=X_AMD64
-endif # ARCH amd64
+  ifeq ($(ARCH), amd64)
+    CPPFLAGS += -DX_ARCH=X_AMD64
+  endif # ARCH amd64
+endif
 
 
 # files needed for MIDI i/o
--- a/make/jdk_generic_profile.sh	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/jdk_generic_profile.sh	Wed Nov 25 22:14:30 2009 -0800
@@ -339,3 +339,82 @@
 PATH="${path4sdk}"
 export PATH
 
+# Export variables required for Zero
+if [ "${ZERO_BUILD}" = true ] ; then
+  # ZERO_LIBARCH is the name of the architecture-specific
+  # subdirectory under $JAVA_HOME/jre/lib
+  arch=$(uname -m)
+  case "${arch}" in
+    x86_64)  ZERO_LIBARCH=amd64     ;;
+    i?86)    ZERO_LIBARCH=i386      ;;
+    sparc64) ZERO_LIBARCH=sparcv9   ;;
+    arm*)    ZERO_LIBARCH=arm       ;;
+    *)       ZERO_LIBARCH="$(arch)"
+  esac
+  export ZERO_LIBARCH
+
+  # ARCH_DATA_MODEL is the number of bits in a pointer
+  case "${ZERO_LIBARCH}" in
+    i386|ppc|s390|sparc|arm)
+      ARCH_DATA_MODEL=32
+      ;;
+    amd64|ppc64|s390x|sparcv9|ia64|alpha)
+      ARCH_DATA_MODEL=64
+      ;;
+    *)
+      echo "ERROR: Unable to determine ARCH_DATA_MODEL for ${ZERO_LIBARCH}"
+      exit 1
+  esac
+  export ARCH_DATA_MODEL
+
+  # ZERO_ENDIANNESS is the endianness of the processor
+  case "${ZERO_LIBARCH}" in
+    i386|amd64|ia64)
+      ZERO_ENDIANNESS=little
+      ;;
+    ppc*|s390*|sparc*|alpha)
+      ZERO_ENDIANNESS=big
+      ;;
+    *)
+      echo "ERROR: Unable to determine ZERO_ENDIANNESS for ${ZERO_LIBARCH}"
+      exit 1
+  esac
+  export ZERO_ENDIANNESS
+
+  # ZERO_ARCHDEF is used to enable architecture-specific code
+  case "${ZERO_LIBARCH}" in
+    i386)   ZERO_ARCHDEF=IA32  ;;
+    ppc*)   ZERO_ARCHDEF=PPC   ;;
+    s390*)  ZERO_ARCHDEF=S390  ;;
+    sparc*) ZERO_ARCHDEF=SPARC ;;
+    *)      ZERO_ARCHDEF=$(echo "${ZERO_LIBARCH}" | tr a-z A-Z)
+  esac
+  export ZERO_ARCHDEF
+
+  # ZERO_ARCHFLAG tells the compiler which mode to build for
+  case "${ZERO_LIBARCH}" in
+    s390)
+      ZERO_ARCHFLAG="-m31"
+      ;;
+    *)
+      ZERO_ARCHFLAG="-m${ARCH_DATA_MODEL}"
+  esac
+  export ZERO_ARCHFLAG
+
+  # LIBFFI_CFLAGS and LIBFFI_LIBS tell the compiler how to compile and
+  # link against libffi
+  pkgconfig=$(which pkg-config 2>/dev/null)
+  if [ -x "${pkgconfig}" ] ; then
+    if [ "${LIBFFI_CFLAGS}" = "" ] ; then
+      LIBFFI_CFLAGS=$("${pkgconfig}" --cflags libffi)
+    fi
+    if [ "${LIBFFI_LIBS}" = "" ] ; then
+      LIBFFI_LIBS=$("${pkgconfig}" --libs libffi)
+    fi
+  fi
+  if [ "${LIBFFI_LIBS}" = "" ] ; then
+      LIBFFI_LIBS="-lffi"
+  fi
+  export LIBFFI_CFLAGS
+  export LIBFFI_LIBS
+fi
--- a/make/jprt.properties	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/jprt.properties	Wed Nov 25 22:14:30 2009 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright 2006-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# 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
@@ -34,8 +34,8 @@
 solaris_x64_5.10,\
 linux_i586_2.6,\
 linux_x64_2.6,\
-windows_i586,\
-windows_x64
+windows_i586_5.0,\
+windows_x64_5.2
 
 # The different build flavors we want
 jprt.build.flavors=product,fastdebug
@@ -51,21 +51,37 @@
 jprt.solaris_sparcv9.build.platform.match32=solaris_sparc_5.10
 jprt.solaris_x64.build.platform.match32=solaris_i586_5.10
 
-# Standard list of jprt test targets for this workspace
+# Standard test target for everybody
 jprt.test.targets=*-*-*-jvm98
-jprt.regression.test.targets=        \
-   *-product-*-java/lang,            \
-   *-product-*-java/security,        \
-   *-product-*-java/text,            \
-   *-product-*-java/util
 
-#jprt.regression.test.targets=   \
-#   *-product-*-java/awt,       \
-#   *-product-*-java/beans,     \
-#   *-product-*-java/io,        \
-#   *-product-*-java/net,       \
-#   *-product-*-java/nio,       \
-#   *-product-*-java/rmi,       \
+# Test targets in test/Makefile (some longer running tests only test c2)
+jprt.make.rule.test.targets=    \
+   *-product-*-jdk_beans1,      \
+   *-product-*-jdk_beans2,      \
+   *-product-*-jdk_beans3,      \
+   *-product-*-jdk_io,          \
+   *-product-*-jdk_lang,        \
+   *-product-*-jdk_management1, \
+   *-product-*-jdk_management2, \
+   *-product-*-jdk_math,        \
+   *-product-*-jdk_misc,        \
+   *-product-*-jdk_net,         \
+   *-product-*-jdk_nio1,        \
+   *-product-*-jdk_nio2,        \
+   *-product-*-jdk_nio3,        \
+   *-product-*-jdk_security1,   \
+   *-product-*-jdk_security2,   \
+   *-product-*-jdk_security3,   \
+   *-product-*-jdk_text,        \
+   *-product-*-jdk_tools1,      \
+   *-product-*-jdk_tools2,      \
+   *-product-*-jdk_util
+
+# Some of these are crashing Xvfb or windows manager, need dedicated DISPLAY per test batch
+jprt2.make.rule.test.targets=    \
+   *-product-*-jdk_awt,         \
+   *-product-*-jdk_rmi,         \
+   *-product-*-jdk_swing,       \
 
 # Directories needed to build
 jprt.bundle.exclude.src.dirs=build
--- a/make/launchers/Makefile.launcher	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/launchers/Makefile.launcher	Wed Nov 25 22:14:30 2009 -0800
@@ -137,15 +137,15 @@
   #   PROGRAM, JAVA_ARGS, and APP_CLASSPATH are used in src/share/bin/java.c
   #   SA is currently not available on windows (for any ARCH), or linux-ia64:
   ifneq ($(ARCH), ia64)
-    JDB_CLASSPATH = "{ \"/lib/tools.jar\", \"/lib/sa-jdi.jar\", \"/classes\" }"
-    OTHER_CPPFLAGS += -DAPP_CLASSPATH=$(JDB_CLASSPATH)
+    JDB_CLASSPATH = { "/lib/tools.jar", "/lib/sa-jdi.jar", "/classes" }
+    OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(JDB_CLASSPATH)'
   endif
 endif
 
 # jconsole only
 ifeq ($(PROGRAM),jconsole)
-  JCONSOLE_CLASSPATH = "{ \"/lib/jconsole.jar\", \"/lib/tools.jar\", \"/classes\" }"
-  OTHER_CPPFLAGS += -DAPP_CLASSPATH=$(JCONSOLE_CLASSPATH)
+  JCONSOLE_CLASSPATH = { "/lib/jconsole.jar", "/lib/tools.jar", "/classes" }
+  OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(JCONSOLE_CLASSPATH)'
   ifeq ($(PLATFORM), windows)
     OTHER_CPPFLAGS += -DJAVAW
     LDLIBS_COMMON  += user32.lib
@@ -163,8 +163,8 @@
 
 # SA tools need special app classpath
 ifeq ($(SA_TOOL),true)
-  SA_CLASSPATH = "{ \"/lib/tools.jar\", \"/lib/sa-jdi.jar\", \"/classes\"}"
-  OTHER_CPPFLAGS += -DAPP_CLASSPATH=$(SA_CLASSPATH)
+  SA_CLASSPATH = { "/lib/tools.jar", "/lib/sa-jdi.jar", "/classes" }
+  OTHER_CPPFLAGS += -DAPP_CLASSPATH='$(SA_CLASSPATH)'
 endif
 
 # Wildcards
@@ -173,11 +173,11 @@
 endif
 
 # Always tell native code what the main class is
-OTHER_CPPFLAGS += -DMAIN_CLASS=\"$(MAIN_CLASS)\"
+OTHER_CPPFLAGS += -DMAIN_CLASS='"$(MAIN_CLASS)"'
 
 # Construct initializer for initial arguments to java
 ALL_ARGS = -J-ms8m $(MAIN_JAVA_ARGS) $(MAIN_CLASS) $(MAIN_ARGS)
-JAVA_ARGS = "{ $(ALL_ARGS:%=\"%\",)  }"
+JAVA_ARGS = { $(ALL_ARGS:%="%",)  }
 
 # Always report launcher info
 build: launcher_info
--- a/make/netbeans/jconsole/build.properties	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/netbeans/jconsole/build.properties	Wed Nov 25 22:14:30 2009 -0800
@@ -33,7 +33,7 @@
     com/sun/tools/jconsole/ \
     sun/tools/jconsole/
 excludes=\
-    sun/tools/jconsole/Version-template.java
+    sun/tools/jconsole/Version.java.template
 jtreg.tests=\
     sun/tools/jconsole/
 javadoc.packagenames=\
--- a/make/netbeans/jconsole/build.xml	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/netbeans/jconsole/build.xml	Wed Nov 25 22:14:30 2009 -0800
@@ -35,7 +35,7 @@
 
     <target name="-pre-compile">
         <copy
-            file="${root}/src/share/classes/sun/tools/jconsole/Version-template.java"
+            file="${root}/src/share/classes/sun/tools/jconsole/Version.java.template"
             tofile="${gensrc.dir}/sun/tools/jconsole/Version.java"/>
         <replace
             file="${gensrc.dir}/sun/tools/jconsole/Version.java"
--- a/make/sun/awt/mapfile-vers	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/awt/mapfile-vers	Wed Nov 25 22:14:30 2009 -0800
@@ -53,7 +53,6 @@
 		Java_sun_awt_image_GifImageDecoder_initIDs;
 		Java_sun_awt_image_GifImageDecoder_parseImage;
 		Java_sun_awt_image_ImageRepresentation_initIDs;
-		Java_sun_awt_image_ImageRepresentation_setBytePixels;
 		Java_sun_awt_image_ImageRepresentation_setDiffICM;
 		Java_sun_awt_image_ImageRepresentation_setICMpixels;
 		Java_sun_awt_image_ImagingLib_convolveBI;
--- a/make/sun/awt/mapfile-vers-linux	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/awt/mapfile-vers-linux	Wed Nov 25 22:14:30 2009 -0800
@@ -55,7 +55,6 @@
 		Java_sun_awt_image_GifImageDecoder_parseImage;
 		Java_sun_awt_image_Image_initIDs;
 		Java_sun_awt_image_ImageRepresentation_initIDs;
-		Java_sun_awt_image_ImageRepresentation_setBytePixels;
 		Java_sun_awt_image_ImageRepresentation_setDiffICM;
 		Java_sun_awt_image_ImageRepresentation_setICMpixels;
 		Java_sun_awt_image_ImagingLib_convolveBI;
--- a/make/sun/javazic/tzdata/VERSION	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/javazic/tzdata/VERSION	Wed Nov 25 22:14:30 2009 -0800
@@ -21,4 +21,4 @@
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
 #
-tzdata2009l
+tzdata2009r
--- a/make/sun/javazic/tzdata/antarctica	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/javazic/tzdata/antarctica	Wed Nov 25 22:14:30 2009 -0800
@@ -102,15 +102,38 @@
 # Davis, Vestfold Hills, -6835+07759, since 1957-01-13
 #	(except 1964-11 - 1969-02)
 # Mawson, Holme Bay, -6736+06253, since 1954-02-13
+
+# From Steffen Thorsen (2009-03-11):
+# Three Australian stations in Antarctica have changed their time zone:
+# Casey moved from UTC+8 to UTC+11
+# Davis moved from UTC+7 to UTC+5
+# Mawson moved from UTC+6 to UTC+5
+# The changes occurred on 2009-10-18 at 02:00 (local times).
+#
+# Government source: (Australian Antarctic Division)
+# <a href="http://www.aad.gov.au/default.asp?casid=37079">
+# http://www.aad.gov.au/default.asp?casid=37079
+# </a>
+#
+# We have more background information here:
+# <a href="http://www.timeanddate.com/news/time/antarctica-new-times.html">
+# http://www.timeanddate.com/news/time/antarctica-new-times.html
+# </a>
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Antarctica/Casey	0	-	zzz	1969
-			8:00	-	WST	# Western (Aus) Standard Time
+			8:00	-	WST	2009 Oct 18 2:00
+						# Western (Aus) Standard Time
+			11:00	-	CAST	# Casey Time
 Zone Antarctica/Davis	0	-	zzz	1957 Jan 13
 			7:00	-	DAVT	1964 Nov # Davis Time
 			0	-	zzz	1969 Feb
-			7:00	-	DAVT
+			7:00	-	DAVT	2009 Oct 18 2:0
+			5:00	-	DAVT
 Zone Antarctica/Mawson	0	-	zzz	1954 Feb 13
-			6:00	-	MAWT	# Mawson Time
+			6:00	-	MAWT	2009 Oct 18 2:00
+						# Mawson Time
+			5:00	-	MAWT
 # References:
 # <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html">
 # Casey Weather (1998-02-26)
--- a/make/sun/javazic/tzdata/asia	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/javazic/tzdata/asia	Wed Nov 25 22:14:30 2009 -0800
@@ -21,7 +21,6 @@
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
 #
-# <pre>
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -194,11 +193,30 @@
 #
 # No DST end date has been announced yet.
 
-# From Arthur David Olson (2009-07-11):
-# Arbitrarily end DST at the end of 2009 so that a POSIX-sytle time zone string
-# can appear in the Dhaka binary file and for the benefit of old glibc
-# reimplementations of the time zone software that mishandle permanent DST.
-# A change will be required once the end date is known.
+# From Alexander Krivenyshev (2009-09-25):
+# Bangladesh won't go back to Standard Time from October 1, 2009, 
+# instead it will continue DST measure till the cabinet makes a fresh decision. 
+#
+# Following report by same newspaper-"The Daily Star Friday":
+# "DST change awaits cabinet decision-Clock won't go back by 1-hr from Oct 1"
+# <a href="http://www.thedailystar.net/newDesign/news-details.php?nid=107021">
+# http://www.thedailystar.net/newDesign/news-details.php?nid=107021
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html">
+# http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html
+# </a>
+
+# From Steffen Thorsen (2009-10-13):
+# IANS (Indo-Asian News Service) now reports:
+# Bangladesh has decided that the clock advanced by an hour to make 
+# maximum use of daylight hours as an energy saving measure would 
+# "continue for an indefinite period."
+#
+# One of many places where it is published:
+# <a href="http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html">
+# http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html
+# </a>
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Dhaka	6:01:40 -	LMT	1890
@@ -208,8 +226,7 @@
 			6:30	-	BURT	1951 Sep 30
 			6:00	-	DACT	1971 Mar 26 # Dacca Time
 			6:00	-	BDT	2009 Jun 19 23:00 # Bangladesh Time
-			6:00	1:00	BDST	2010
-			6:00	-	BDT
+			6:00	1:00	BDST
 
 # Bhutan
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -373,14 +390,84 @@
 			5:00	-	KAST	1980 May
 			8:00	PRC	C%sT
 
+
+# From Lee Yiu Chung (2009-10-24):
+# I found there are some mistakes for the historial DST rule for Hong
+# Kong. Accoring to the DST record from Hong Kong Observatory (actually,
+# it is not [an] observatory, but the official meteorological agency of HK,
+# and also serves as the official timing agency), there are some missing
+# and incorrect rules. Although the exact switch over time is missing, I
+# think 3:30 is correct. The official DST record for Hong Kong can be
+# obtained from
+# <a href="http://www.hko.gov.hk/gts/time/Summertime.htm">
+# http://www.hko.gov.hk/gts/time/Summertime.htm
+# </a>.
+
+# From Arthur David Olson (2009-10-28):
+# Here are the dates given at
+# <a href="http://www.hko.gov.hk/gts/time/Summertime.htm">
+# http://www.hko.gov.hk/gts/time/Summertime.htm
+# </a>
+# as of 2009-10-28:
+# Year        Period
+# 1941        1 Apr to 30 Sep
+# 1942        Whole year 
+# 1943        Whole year
+# 1944        Whole year
+# 1945        Whole year
+# 1946        20 Apr to 1 Dec
+# 1947        13 Apr to 30 Dec
+# 1948        2 May to 31 Oct
+# 1949        3 Apr to 30 Oct
+# 1950        2 Apr to 29 Oct
+# 1951        1 Apr to 28 Oct
+# 1952        6 Apr to 25 Oct
+# 1953        5 Apr to 1 Nov
+# 1954        21 Mar to 31 Oct
+# 1955        20 Mar to 6 Nov
+# 1956        18 Mar to 4 Nov
+# 1957        24 Mar to 3 Nov
+# 1958        23 Mar to 2 Nov
+# 1959        22 Mar to 1 Nov
+# 1960        20 Mar to 6 Nov
+# 1961        19 Mar to 5 Nov
+# 1962        18 Mar to 4 Nov
+# 1963        24 Mar to 3 Nov
+# 1964        22 Mar to 1 Nov
+# 1965        18 Apr to 17 Oct
+# 1966        17 Apr to 16 Oct
+# 1967        16 Apr to 22 Oct
+# 1968        21 Apr to 20 Oct
+# 1969        20 Apr to 19 Oct
+# 1970        19 Apr to 18 Oct
+# 1971        18 Apr to 17 Oct
+# 1972        16 Apr to 22 Oct
+# 1973        22 Apr to 21 Oct
+# 1973/74     30 Dec 73 to 20 Oct 74
+# 1975        20 Apr to 19 Oct
+# 1976        18 Apr to 17 Oct
+# 1977        Nil
+# 1978        Nil
+# 1979        13 May to 21 Oct
+# 1980 to Now Nil
+# The page does not give start or end times of day.
+# The page does not give a start date for 1942.
+# The page does not givw an end date for 1945.
+# The Japanese occupation of Hong Kong began on 1941-12-25.
+# The Japanese surrender of Hong Kong was signed 1945-09-15.
+# For lack of anything better, use start of those days as the transition times.
+
 # Hong Kong (Xianggang)
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	HK	1941	only	-	Apr	1	3:30	1:00	S
+Rule	HK	1941	only	-	Sep	30	3:30	0	-
 Rule	HK	1946	only	-	Apr	20	3:30	1:00	S
 Rule	HK	1946	only	-	Dec	1	3:30	0	-
 Rule	HK	1947	only	-	Apr	13	3:30	1:00	S
 Rule	HK	1947	only	-	Dec	30	3:30	0	-
 Rule	HK	1948	only	-	May	2	3:30	1:00	S
-Rule	HK	1948	1952	-	Oct	lastSun	3:30	0	-
+Rule	HK	1948	1951	-	Oct	lastSun	3:30	0	-
+Rule	HK	1952	only	-	Oct	25	3:30	0	-
 Rule	HK	1949	1953	-	Apr	Sun>=1	3:30	1:00	S
 Rule	HK	1953	only	-	Nov	1	3:30	0	-
 Rule	HK	1954	1964	-	Mar	Sun>=18	3:30	1:00	S
@@ -388,13 +475,15 @@
 Rule	HK	1955	1964	-	Nov	Sun>=1	3:30	0	-
 Rule	HK	1965	1977	-	Apr	Sun>=16	3:30	1:00	S
 Rule	HK	1965	1977	-	Oct	Sun>=16	3:30	0	-
-Rule	HK	1979	1980	-	May	Sun>=8	3:30	1:00	S
-Rule	HK	1979	1980	-	Oct	Sun>=16	3:30	0	-
+Rule	HK	1973	only	-	Dec	30	3:30	1:00	S
+Rule	HK	1979	only	-	May	Sun>=8	3:30	1:00	S
+Rule	HK	1979	only	-	Oct	Sun>=16	3:30	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Hong_Kong	7:36:36 -	LMT	1904 Oct 30
+			8:00	HK	HK%sT	1941 Dec 25
+			9:00	-	JST	1945 Sep 15
 			8:00	HK	HK%sT
 
-
 ###############################################################################
 
 # Taiwan
@@ -1696,16 +1785,66 @@
 # advance clocks in the country by one hour from April 15 to
 # conserve energy"
 
-# From Arthur David Olson (2009-04-10):
-# Assume for now that Pakistan will end DST in 2009 as it did in 2008.
+# From Steffen Thorsen (2009-09-17):
+# "The News International," Pakistan reports that: "The Federal
+# Government has decided to restore the previous time by moving the
+# clocks backward by one hour from October 1. A formal announcement to
+# this effect will be made after the Prime Minister grants approval in
+# this regard." 
+# <a href="http://www.thenews.com.pk/updates.asp?id=87168">
+# http://www.thenews.com.pk/updates.asp?id=87168
+# </a>
+
+# From Alexander Krivenyshev (2009-09-28):
+# According to Associated Press Of Pakistan, it is confirmed that
+# Pakistan clocks across the country would be turned back by an hour from October
+# 1, 2009.
+#
+# "Clocks to go back one hour from 1 Oct"
+# <a href="http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=86715&Itemid=2">
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=86715&Itemid=2
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm">
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm
+# </a>
+
+# From Steffen Thorsen (2009-09-29):
+# Alexander Krivenyshev wrote:
+# > According to Associated Press Of Pakistan, it is confirmed that
+# > Pakistan clocks across the country would be turned back by an hour from October
+# > 1, 2009.
+#
+# Now they seem to have changed their mind, November 1 is the new date:
+# <a href="http://www.thenews.com.pk/top_story_detail.asp?Id=24742">
+# http://www.thenews.com.pk/top_story_detail.asp?Id=24742
+# </a>
+# "The country's clocks will be reversed by one hour on November 1.
+# Officials of Federal Ministry for Interior told this to Geo News on
+# Monday."
+#
+# And more importantly, it seems that these dates will be kept every year:
+# "It has now been decided that clocks will be wound forward by one hour
+# on April 15 and reversed by an hour on November 1 every year without
+# obtaining prior approval, the officials added."
+#
+# We have confirmed this year's end date with both with the Ministry of
+# Water and Power and the Pakistan Electric Power Company:
+# <a href="http://www.timeanddate.com/news/time/pakistan-ends-dst09.html">
+# http://www.timeanddate.com/news/time/pakistan-ends-dst09.html
+# </a>
+
+# From Christoph Goehre (2009-10-01):
+# [T]he German Consulate General in Karachi reported me today that Pakistan
+# will go back to standard time on 1st of November.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
 Rule Pakistan	2002	only	-	Oct	Sun>=2	0:01	0	-
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
-Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	max	-	Apr	15	0:00	1:00	S
+Rule Pakistan	2009	max	-	Nov	1	0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep
@@ -1858,6 +1997,42 @@
 # http://www.worldtimezone.com/dst_news/dst_news_westbank01.html
 # </a>
 
+# From Steffen Thorsen (2009-08-31):
+# Palestine's Council of Ministers announced that they will revert back to
+# winter time on Friday, 2009-09-04.
+#
+# One news source:
+# <a href="http://www.safa.ps/ara/?action=showdetail&seid=4158">
+# http://www.safa.ps/ara/?action=showdetail&seid=4158
+# </a>
+# (Palestinian press agency, Arabic),
+# Google translate: "Decided that the Palestinian government in Ramallah
+# headed by Salam Fayyad, the start of work in time for the winter of
+# 2009, starting on Friday approved the fourth delay Sept. clock sixty
+# minutes per hour as of Friday morning."
+#
+# We are not sure if Gaza will do the same, last year they had a different
+# end date, we will keep this page updated:
+# <a href="http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html">
+# http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
+# </a>
+
+# From Alexander Krivenyshev (2009-09-02):
+# Seems that Gaza Strip will go back to Winter Time same date as West Bank.
+#
+# According to Palestinian Ministry Of Interior, West Bank and Gaza Strip plan
+# to change time back to Standard time on September 4, 2009.
+#
+# "Winter time unite the West Bank and Gaza"
+# (from Palestinian National Authority):
+# <a href="http://www.moi.gov.ps/en/?page=633167343250594025&nid=11505
+# http://www.moi.gov.ps/en/?page=633167343250594025&nid=11505
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_gazastrip02.html>
+# http://www.worldtimezone.com/dst_news/dst_news_gazastrip02.html
+# </a>
+
 # The rules for Egypt are stolen from the `africa' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -1876,7 +2051,7 @@
 Rule Palestine	2007	only	-	Sep	Thu>=8	2:00	0	-
 Rule Palestine	2008	only	-	Aug	lastFri	2:00	0	-
 Rule Palestine	2009	max	-	Mar	lastFri	0:00	1:00	S
-Rule Palestine	2009	max	-	Sep	lastMon	2:00	0	-
+Rule Palestine	2009	max	-	Sep	Fri>=1	2:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct
@@ -2154,9 +2329,23 @@
 # http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
 # </a>
 
+# From Steffen Thorsen (2009-10-27):
+# The Syrian Arab News Network on 2009-09-29 reported that Syria will 
+# revert back to winter (standard) time on midnight between Thursday 
+# 2009-10-29 and Friday 2009-10-30:
+# <a href="http://www.sana.sy/ara/2/2009/09/29/247012.htm">
+# http://www.sana.sy/ara/2/2009/09/29/247012.htm (Arabic)
+# </a>
+
+# From Arthur David Olson (2009-10-28):
+# We'll see if future DST switching times turn out to be end of the last
+# Thursday of the month or the start of the last Friday of the month or
+# something else. For now, use the start of the last Friday.
+
 Rule	Syria	2008	only	-	Apr	Fri>=1	0:00	1:00	S
-Rule	Syria	2008	max	-	Nov	1	0:00	0	-
+Rule	Syria	2008	only	-	Nov	1	0:00	0	-
 Rule	Syria	2009	max	-	Mar	lastFri	0:00	1:00	S
+Rule	Syria	2009	max	-	Oct	lastFri	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Damascus	2:25:12 -	LMT	1920	# Dimashq
--- a/make/sun/javazic/tzdata/australasia	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/javazic/tzdata/australasia	Wed Nov 25 22:14:30 2009 -0800
@@ -465,10 +465,56 @@
 # http://www.worldtimezone.com/dst_news/dst_news_samoa01.html
 # </a>
 
+# From Steffen Thorsen (2009-08-27):
+# Samoa's parliament passed the Daylight Saving Bill 2009, and will start 
+# daylight saving time on the first Sunday of October 2009 and end on the 
+# last Sunday of March 2010. We hope that the full text will be published 
+# soon, but we believe that the bill is only valid for 2009-2010. Samoa's 
+# Daylight Saving Act 2009 will be enforced as soon as the Head of State 
+# executes a proclamation publicizing this Act.
+#
+# Some background information here, which will be updated once we have 
+# more details:
+# <a href="http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html">
+# http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
+# </a>
+
+# From Alexander Krivenyshev (2009-10-03):
+# First, my deepest condolences to people of Samoa islands and all families and
+# loved ones around the world who lost their lives in the earthquake and tsunami.
+#
+# Considering the recent devastation on Samoa by earthquake and tsunami and that
+# many government offices/ ministers are closed- not sure if "Daylight Saving
+# Bill 2009" will be implemented in next few days- on October 4, 2009.
+#
+# Here is reply from Consulate-General of Samoa in New Zealand
+# ---------------------------
+# Consul General
+# consulgeneral@samoaconsulate.org.nz
+#
+# Talofa Alexander,
+#
+# Thank you for your sympathy for our country but at this time we have not
+# been informed about the Daylight Savings Time Change.  Most Ministries in
+# Apia are closed or relocating due to weather concerns.
+#
+# When we do find out if they are still proceeding with the time change we
+# will advise you soonest.
+#
+# Kind Regards,
+# Lana
+# for: Consul General
+
+# From Steffen Thorsen (2009-10-05):
+# We have called a hotel in Samoa and asked about local time there - they 
+# are still on standard time.
+
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
-			-11:00	-	WST			# Samoa Time
+			-11:00	-	WST	2009 Oct 4
+			-11:00	1:00	WSDT	2010 Mar 28
+			-11:00	-	WST
 
 # Solomon Is
 # excludes Bougainville, for which see Papua New Guinea
--- a/make/sun/javazic/tzdata/europe	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/javazic/tzdata/europe	Wed Nov 25 22:14:30 2009 -0800
@@ -2094,9 +2094,43 @@
 			 6:00	Russia	NOV%sT	1992 Jan 19 2:00s
 			 7:00	Russia	NOV%sT	1993 May 23 # say Shanks & P.
 			 6:00	Russia	NOV%sT
+
+# From Alexander Krivenyshev (2009-10-13):
+# Kemerovo oblast' (Kemerovo region) in Russia will change current time zone on
+# March 28, 2010:
+# from current Russia Zone 6 - Krasnoyarsk Time Zone (KRA) UTC +0700
+# to Russia Zone 5 - Novosibirsk Time Zone (NOV) UTC +0600
+#
+# This is according to Government of Russia decree # 740, on September
+# 14, 2009 "Application in the territory of the Kemerovo region the Fifth
+# time zone." ("Russia Zone 5" or old "USSR Zone 5" is GMT +0600)
+#
+# Russian Government web site (Russian language)
+# <a href="http://www.government.ru/content/governmentactivity/rfgovernmentdecisions/archiv">
+# http://www.government.ru/content/governmentactivity/rfgovernmentdecisions/archive/2009/09/14/991633.htm
+# </a>
+# or Russian-English translation by WorldTimeZone.com with reference
+# map to local region and new Russia Time Zone map after March 28, 2010
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_russia03.html">
+# http://www.worldtimezone.com/dst_news/dst_news_russia03.html
+# </a>
+#
+# Thus, when Russia will switch to DST on the night of March 28, 2010
+# Kemerovo region (Kemerovo oblast') will not change the clock.
+#
+# As a result, Kemerovo oblast' will be in the same time zone as
+# Novosibirsk, Omsk, Tomsk, Barnaul and Altai Republic.
+
+Zone Asia/Novokuznetsk	 5:48:48 -	NMT	1920 Jan  6
+			 6:00	-	KRAT	1930 Jun 21 # Krasnoyarsk Time
+			 7:00	Russia	KRA%sT	1991 Mar 31 2:00s
+			 6:00	Russia	KRA%sT	1992 Jan 19 2:00s
+			 7:00	Russia	KRA%sT	2010 Mar 28 2:00s
+			 6:00	Russia	NOV%sT # Novosibirsk/Novokuznetsk Time
+
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
-# Kemerovskaya oblast', Krasnoyarskij kraj,
+# Krasnoyarskij kraj,
 # Tajmyrskij (Dolgano-Nenetskij) avtonomnyj okrug,
 # Respublika Tuva, Respublika Khakasiya, Evenkijskij avtonomnyj okrug.
 Zone Asia/Krasnoyarsk	 6:11:20 -	LMT	1920 Jan  6
--- a/make/sun/javazic/tzdata/southamerica	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/javazic/tzdata/southamerica	Wed Nov 25 22:14:30 2009 -0800
@@ -237,9 +237,23 @@
 # http://www.jujuy.gov.ar/index2/partes_prensa/18_10_08/235-181008.doc
 # </a>
 
+# From fullinet (2009-10-18):
+# As announced in
+# <a hef="http://www.argentina.gob.ar/argentina/portal/paginas.dhtml?pagina=356">
+# http://www.argentina.gob.ar/argentina/portal/paginas.dhtml?pagina=356
+# </a>
+# (an official .gob.ar) under title: "Sin Cambio de Hora" (english: "No hour change")
+#
+# "Por el momento, el Gobierno Nacional resolvio no modificar la hora
+# oficial, decision que estaba en estudio para su implementacion el
+# domingo 18 de octubre. Desde el Ministerio de Planificacion se anuncio
+# que la Argentina hoy, en estas condiciones meteorologicas, no necesita
+# la modificacion del huso horario, ya que 2009 nos encuentra con
+# crecimiento en la produccion y distribucion energetica."
+
 Rule	Arg	2007	only	-	Dec	30	0:00	1:00	S
-Rule	Arg	2008	max	-	Mar	Sun>=15	0:00	0	-
-Rule	Arg	2008	max	-	Oct	Sun>=15	0:00	1:00	S
+Rule	Arg	2008	2009	-	Mar	Sun>=15	0:00	0	-
+Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:00	S
  
 # From Mariano Absatz (2004-05-21):
 # Today it was officially published that the Province of Mendoza is changing
@@ -411,15 +425,40 @@
 # during 2009, this timezone change will run from 00:00 the third Sunday
 # in March until 24:00 of the second Saturday in October.
 
-# From Arthur David Olson (2009-03-16):
-# The unofficial claim at
-# <a href="http://www.timeanddate.com/news/time/san-luis-new-time-zone.html">
-# http://www.timeanddate.com/news/time/san-luis-new-time-zone.html
+# From Mariano Absatz (2009-10-16):
+# ...the Province of San Luis is a case in itself.
+#
+# The Law at
+# <a href="http://www.diputadossanluis.gov.ar/diputadosasp/paginas/verNorma.asp?NormaID=276>"
+# http://www.diputadossanluis.gov.ar/diputadosasp/paginas/verNorma.asp?NormaID=276
 # </a>
-# is that "The province will most likely follow the next daylight saving schedule,
-# which is planned for the second Sunday in October."
+# is ambiguous because establishes a calendar from the 2nd Sunday in
+# October at 0:00 thru the 2nd Saturday in March at 24:00 and the
+# complement of that starting on the 2nd Sunday of March at 0:00 and
+# ending on the 2nd Saturday of March at 24:00.
+#
+# This clearly breaks every time the 1st of March or October is a Sunday.
+#
+# IMHO, the "spirit of the Law" is to make the changes at 0:00 on the 2nd
+# Sunday of October and March.
+#
+# The problem is that the changes in the rest of the Provinces that did
+# change in 2007/2008, were made according to the Federal Law and Decrees
+# that did so on the 3rd Sunday of October and March.
+#
+# In fact, San Luis actually switched from UTC-4 to UTC-3 last Sunday
+# (October 11th) at 0:00.
+#
+# So I guess a new set of rules, besides "Arg", must be made and the last
+# America/Argentina/San_Luis entries should change to use these...
+#
+# I'm enclosing a patch that does what I say... regretfully, the San Luis
+# timezone must be called "WART/WARST" even when most of the time (like,
+# right now) WARST == ART... that is, since last Sunday, all the country
+# is using UTC-3, but in my patch, San Luis calls it "WARST" and the rest
+# of the country calls it "ART".
+# ...
 
-#
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
 # Buenos Aires (BA), Capital Federal (CF),
@@ -552,6 +591,10 @@
 			-3:00	-	ART
 #
 # San Luis (SL)
+
+Rule	SanLuis	2008	max	-	Mar	Sun>=8	0:00	0	-
+Rule	SanLuis	2007	max	-	Oct	Sun>=8	0:00	1:00	S
+
 Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
 			-4:16:48 -	CMT	1920 May
 			-4:00	-	ART	1930 Dec
@@ -566,8 +609,7 @@
 			-3:00	-	ART	2004 May 31
 			-4:00	-	WART	2004 Jul 25
 			-3:00	Arg	AR%sT	2008 Jan 21
-			-3:00	-	ART	2009 Mar 15
-			-4:00	Arg	WAR%sT
+			-4:00	SanLuis	WAR%sT
 #
 # Santa Cruz (SC)
 Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
--- a/make/sun/javazic/tzdata/zone.tab	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/javazic/tzdata/zone.tab	Wed Nov 25 22:14:30 2009 -0800
@@ -352,6 +352,7 @@
 RU	+5651+06036	Asia/Yekaterinburg	Moscow+02 - Urals
 RU	+5500+07324	Asia/Omsk	Moscow+03 - west Siberia
 RU	+5502+08255	Asia/Novosibirsk	Moscow+03 - Novosibirsk
+RU	+5345+08707	Asia/Novokuznetsk	Moscow+03 - Novokuznetsk
 RU	+5601+09250	Asia/Krasnoyarsk	Moscow+04 - Yenisei River
 RU	+5216+10420	Asia/Irkutsk	Moscow+05 - Lake Baikal
 RU	+6200+12940	Asia/Yakutsk	Moscow+06 - Lena River
--- a/make/sun/jconsole/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/jconsole/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -70,7 +70,7 @@
 build: $(FILES_png) $(FILES_gif) $(TEMPDIR)/manifest $(JARFILE)
 
 $(GENSRCDIR)/sun/tools/jconsole/Version.java: \
-                $(SHARE_SRC)/classes/sun/tools/jconsole/Version-template.java
+                $(SHARE_SRC)/classes/sun/tools/jconsole/Version.java.template
 	$(MKDIR) -p $(@D)
 	$(SED) -e 's/@@jconsole_version@@/$(FULL_VERSION)/g' $< > $@
 
--- a/make/sun/net/FILES_java.gmk	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/net/FILES_java.gmk	Wed Nov 25 22:14:30 2009 -0800
@@ -45,8 +45,14 @@
 	sun/net/dns/ResolverConfiguration.java \
 	sun/net/dns/ResolverConfigurationImpl.java \
 	sun/net/ftp/FtpClient.java \
+	sun/net/ftp/FtpClientProvider.java \
+	sun/net/ftp/FtpDirEntry.java \
+	sun/net/ftp/FtpReplyCode.java \
+	sun/net/ftp/FtpDirParser.java \
 	sun/net/ftp/FtpLoginException.java \
 	sun/net/ftp/FtpProtocolException.java \
+	sun/net/ftp/impl/FtpClient.java \
+	sun/net/ftp/impl/DefaultFtpClientProvider.java \
 	sun/net/spi/DefaultProxySelector.java \
 	sun/net/spi/nameservice/NameServiceDescriptor.java \
 	sun/net/spi/nameservice/NameService.java \
@@ -79,7 +85,6 @@
 	sun/net/www/http/Hurryable.java \
 	sun/net/www/protocol/http/Handler.java \
 	sun/net/www/protocol/http/HttpURLConnection.java \
-	sun/net/www/protocol/http/HttpLogFormatter.java \
 	sun/net/www/protocol/http/HttpAuthenticator.java \
 	sun/net/www/protocol/http/AuthenticationHeader.java \
 	sun/net/www/protocol/http/AuthenticationInfo.java \
@@ -89,11 +94,13 @@
 	sun/net/www/protocol/http/AuthScheme.java \
 	sun/net/www/protocol/http/BasicAuthentication.java \
 	sun/net/www/protocol/http/DigestAuthentication.java \
-	sun/net/www/protocol/http/NTLMAuthentication.java \
 	sun/net/www/protocol/http/NTLMAuthenticationProxy.java \
 	sun/net/www/protocol/http/NegotiateAuthentication.java \
-	sun/net/www/protocol/http/NegotiatorImpl.java \
-	sun/net/www/protocol/http/NegotiateCallbackHandler.java \
+	sun/net/www/protocol/http/Negotiator.java \
+	sun/net/www/protocol/http/ntlm/NTLMAuthentication.java \
+	sun/net/www/protocol/http/spnego/NegotiatorImpl.java \
+	sun/net/www/protocol/http/spnego/NegotiateCallbackHandler.java \
+	sun/net/www/protocol/http/logging/HttpLogFormatter.java \
 	sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java \
 	sun/net/www/protocol/https/HttpsClient.java \
 	sun/net/www/protocol/https/DefaultHostnameVerifier.java \
@@ -128,7 +135,7 @@
 	sun/net/idn/StringPrep.java
 
 ifeq ($(PLATFORM), windows)
-    FILES_java += sun/net/www/protocol/http/NTLMAuthSequence.java 
+    FILES_java += sun/net/www/protocol/http/ntlm/NTLMAuthSequence.java 
 endif
 
 ifeq ($(PLATFORM), solaris)
--- a/make/sun/nio/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/nio/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -44,14 +44,6 @@
 include FILES_java.gmk
 AUTO_FILES_JAVA_DIRS = sun/nio/cs/ext
 
-# Exclude a few sources on windows
-ifeq ($(PLATFORM), windows)
-  AUTO_JAVA_PRUNE = sun/nio/cs/ext/COMPOUND_TEXT.java         \
-                    sun/nio/cs/ext/COMPOUND_TEXT_Decoder.java \
-                    sun/nio/cs/ext/COMPOUND_TEXT_Encoder.java \
-                    sun/nio/cs/ext/CompoundTextSupport.java
-endif # PLATFORM
-
 # For Cygwin, command line arguments that are paths must be converted to
 # windows style paths. These paths cannot be used as targets, however, because 
 # the ":" in them  will interfere with GNU Make rules, generating "multiple
--- a/make/sun/security/other/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/sun/security/other/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -39,6 +39,7 @@
     sun/security/provider \
     sun/security/rsa \
     sun/security/ssl \
+    sun/security/ssl/krb5 \
     sun/security/timestamp \
     sun/security/validator \
     sun/security/x509 \
--- a/make/tools/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ b/make/tools/Makefile	Wed Nov 25 22:14:30 2009 -0800
@@ -38,7 +38,6 @@
   compile_properties        \
   dir_diff                  \
   dtdbuilder                \
-  fontchecker               \
   freetypecheck             \
   generate_break_iterator   \
   GenerateCharacter         \
--- a/make/tools/fontchecker/Makefile	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#
-# 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 fontchecker tool
-#
-
-BUILDDIR = ../..
-PACKAGE = build.tools.fontchecker
-PRODUCT = tools
-PROGRAM = fontchecker
-include $(BUILDDIR)/common/Defs.gmk
-
-BUILDTOOL_SOURCE_ROOT = $(BUILDDIR)/tools/src
-BUILDTOOL_MAIN        = $(PKGDIR)/FontChecker.java
-
-#
-# Build tool jar rules.
-#
-include $(BUILDDIR)/common/BuildToolJar.gmk
-
--- a/make/tools/src/build/tools/fontchecker/FontCheckDummy.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-/*
- * Copyright 2002-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.
- */
-
-package build.tools.fontchecker;
-
-import java.awt.*;
-import java.awt.image.*;
-import java.io.*;
-
-/**
- * FontCheckDummy (not unlike Crash Test Dummy).
- *
- * <PRE>
- * FontCheckDummy is the "child" process. Its task is to verify
- * integrity of system fonts. Since unexpected crashes are known
- * to occur when certain fonts are manipulated, the process is
- * "monitored" by the parent process, which might have to restart
- * the "child" if it crashes.
- * </PRE>
- *
- * @author Ilya Bagrak
- */
-public class FontCheckDummy implements FontCheckerConstants {
-
-    /**
-     * Input stream from parent process.
-     */
-    private BufferedReader is;
-
-    /**
-     * Output stream to parent process.
-     */
-    private BufferedOutputStream os;
-
-    /**
-     * Image on which font characters will be drawn.
-     */
-    private BufferedImage bi;
-
-    /**
-     * graphics object on which characters will be drawn.
-     */
-    private Graphics graphics;
-
-    /**
-     * This constructor wraps the process's standard output and input streams
-     * to enable easier communication with parent process. It also initializes
-     * the graphics object used for drawing font characters.
-     * <BR><BR>
-     * @see FontCheckerConstants
-     */
-    public FontCheckDummy() {
-        is = new BufferedReader(new InputStreamReader(System.in));
-        os = new BufferedOutputStream(System.out);
-        /* make suffficient space for 12 point font */
-        bi = new BufferedImage(40, 40, BufferedImage.TYPE_INT_RGB);
-        graphics = bi.getGraphics();
-        try {
-            os.write(CHILD_STARTED_OK);
-            os.flush();
-        } catch (IOException e) {
-            System.exit(-1);
-        }
-    }
-
-    /**
-     * Initializes an instance of Font from given font path.
-     * <BR>
-     * This methods attempts to create an instance of font from
-     * a string that represents path to the font file.
-     * <BR><BR>
-     * @param fontPath string representing path to font file
-     * @param flag indicating whether or not checking of non-TrueType fonts
-     * is necessary
-     */
-    private void testFont(String fontPath, boolean checkNonTTF) {
-
-        FontFileFilter fff = new FontFileFilter(checkNonTTF);
-        File fontFile = new File(fontPath);
-        if (!fontFile.canRead()) {
-            try {
-                os.write(ERR_FONT_NOT_FOUND);
-                os.flush();
-            } catch (IOException e) {
-                System.exit(-1);
-            }
-        }
-        Font font = null;
-        try {
-            File file = new File(fontPath);
-            font = Font.createFont(fff.getFontType(fontPath), file);
-        } catch (FontFormatException e1) {
-        } catch (IOException e2) {
-        }
-        if (font == null) {
-             return;
-        }
-        font = font.deriveFont(Font.PLAIN, 12);
-        String name = font.getFontName();
-        String family = font.getFamily();
-
-        char[] testChars = { '0' };
-        if (font.canDisplay(testChars[0])) {
-            graphics.setFont(font);
-            graphics.drawChars(testChars, 0, 1, 20, 20);
-        }
-        try {
-            os.write(ERR_FONT_OK);
-            os.flush();
-        } catch (IOException e) {
-            System.exit(-1);
-        }
-    }
-
-    /**
-     * Begins synchronous communication betweeen parent and child processes.
-     * <BR>
-     * This method begins communication between parent and child processes.
-     * FontCheckDummy reads a line of text from input stream (@see #is).
-     */
-    public void run() {
-        String command = null;
-        while (true) {
-            try {
-                command = is.readLine();
-            } catch (IOException e) {
-                System.exit(-1);
-            }
-            if (command != null && command.length() >= 1) {
-                int cmd = Integer.parseInt(command.substring(0,1));
-                if (cmd == EXITCOMMAND) {
-                    return;
-                }
-                boolean checkNonTTF = ((cmd == 1) ? true : false);
-                String fontPath = command.substring(1);
-                testFont(fontPath, checkNonTTF);
-            } else {
-                return;
-            }
-        }
-    }
-
-    public static void main(String[] args) {
-        try {
-            /* Background app. */
-            System.setProperty("java.awt.headless", "true");
-            System.setProperty("sun.java2d.noddraw", "true");
-            new FontCheckDummy().run();
-        } catch (Throwable t) {
-        }
-        System.exit(0);
-    }
-}
--- a/make/tools/src/build/tools/fontchecker/FontChecker.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,452 +0,0 @@
-/*
- * Copyright 2002-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.
- */
-
-package build.tools.fontchecker;
-
-import java.io.*;
-import java.util.*;
-import java.awt.event.*;
-import sun.font.FontManager;
-
-/**
- * FontChecker.
- *
- * <PRE>
- * This is a FontChecker program. This class is a "parent" process
- * which invokes a "child" process. The child process will test
- * series of fonts and may crash as it encounters invalid fonts.
- * The "parent" process must then interpret error codes passed to it
- * by the "child" process and restart the "child" process if necessary.
- *
- * usage: java FontChecker [-v] -o outputfile
- *
- *        -o is the name of the file to contains canonical path names of
- *           bad fonts that are identified. This file is not created if
- *           no bad fonts are found.
- *        -v verbose: prints progress messages.
- *
- * </PRE>
- *
- * @author Ilya Bagrak
- */
-public class FontChecker implements ActionListener, FontCheckerConstants {
-
-    /**
-     * Output stream to subprocess.
-     * Corresponds to the subprocess's System.in".
-     */
-    private PrintWriter procPipeOut;
-
-    /**
-     * Input stream from subprocess.
-     * Corresponds to the subprocess's System.out".
-     */
-    private BufferedInputStream procPipeIn;
-
-    /**
-     * Child process.
-     */
-    private Process childProc;
-
-    /**
-     * Name of output file to write file names of bad fonts
-     */
-    private String outputFile;
-
-    /**
-     * Reference to currently executing thread.
-     */
-    private Thread currThread;
-
-    /**
-     * Timeout timer for a single font check
-     */
-    private javax.swing.Timer timeOne;
-
-    /**
-     * Timeout timer for all font checks
-     */
-    private javax.swing.Timer timeAll;
-
-    /**
-     * max time (in milliseconds) allowed for checking a single font.
-     */
-    private static int timeoutOne = 10000;
-
-    /**
-     * max time (in milliseconds) allowed for checking all fonts.
-     */
-    private static int timeoutAll = 120000;
-
-    /**
-     * Boolean flag indicating whether FontChecker is required to
-     * check non-TrueType fonts.
-     */
-    private boolean checkNonTTF = false;
-
-    /**
-     * List of bad fonts found in the system.
-     */
-    private Vector badFonts = new Vector();
-
-    /**
-     * whether to print warnings messges etc to stdout/err
-     * default is false
-     */
-    private static boolean verbose = false;
-
-    /* Command to use to exec sub-process. */
-    private static String javaCmd = "java";
-
-    static void printlnMessage(String s) {
-        if (verbose) {
-            System.out.println(s);
-        }
-    }
-
-    /**
-     * Event handler for timer event.
-     * <BR>
-     * Stops the timer and interrupts the current thread which is
-     * still waiting on I/O from the child process.
-     * <BR><BR>
-     * @param evt timer event
-     */
-    public void actionPerformed(ActionEvent evt) {
-        if (evt.getSource() == timeOne) {
-            timeOne.stop();
-            printlnMessage("Child timed out: killing");
-            childProc.destroy();
-        } else {
-            doExit(); // went on too long (ie timeAll timed out).
-        }
-    }
-
-    /**
-     * Initializes a FontChecker.
-     * <BR>
-     * This method is usually called after an unrecoverable error has
-     * been detected and a child process has  either crashed or is in bad
-     * state. The method creates a new child process from
-     * scratch and initializes it's input/output streams.
-     */
-    public void initialize() {
-        try {
-            if (childProc != null) {
-                childProc.destroy();
-            }
-            String fileSeparator = System.getProperty("file.separator");
-            String javaHome = System.getProperty("java.home");
-            String classPath =  System.getProperty("java.class.path");
-            classPath = "\"" + classPath + "\"";
-            String opt = "-cp " + classPath + " -Dsun.java2d.fontpath=\"" +
-                javaHome + fileSeparator + "lib" + fileSeparator + "fonts\"";
-
-            /* command to exec the child process with the same JRE */
-            String cmd =
-                new String(javaHome + fileSeparator + "bin" +
-                           fileSeparator + javaCmd +
-                           " -XXsuppressExitMessage " + opt +
-                           " com.sun.java2d.fontchecker.FontCheckDummy");
-            printlnMessage("cmd="+cmd);
-            childProc = Runtime.getRuntime().exec(cmd);
-
-        } catch (IOException e) {
-            printlnMessage("can't execute child process");
-            System.exit(0);
-        } catch (SecurityException e) {
-            printlnMessage("Error: access denied");
-            System.exit(0);
-        }
-
-        /* initialize input/output streams to/from child process */
-        procPipeOut = new PrintWriter(childProc.getOutputStream());
-        procPipeIn = new BufferedInputStream(childProc.getInputStream());
-
-        try {
-            int code = procPipeIn.read();
-            if (code != CHILD_STARTED_OK) {
-                printlnMessage("bad child process start status="+code);
-                doExit();
-            }
-        } catch (IOException e) {
-            printlnMessage("can't read child process start status unknown");
-            doExit();
-        }
-    }
-
-    private void doExit() {
-        try {
-            if (procPipeOut != null) {
-                /* Tell the child to exit */
-                procPipeOut.write(EXITCOMMAND+System.getProperty("line.separator"));
-                procPipeOut.flush();
-                procPipeOut.close();
-            }
-        } catch (Throwable t) {
-        }
-        System.exit(0);
-    }
-
-    /**
-     * Tries to verify integrity of a font specified by a path.
-     * <BR>
-     * This method is used to test whether a font specified by the given
-     * path is valid and does not crash the system.
-     * <BR><BR>
-     * @param fontPath a string representation of font path
-     * to standard out during while this font is tried
-     * @return returns <code>true</code> if font is OK, and
-     * <code>false</code> otherwise.
-     */
-    public boolean tryFont(File fontFile) {
-        int bytesRead = 0;
-        String fontPath = fontFile.getAbsolutePath();
-
-        printlnMessage("Checking font "+fontPath);
-
-        /* store reference to the current thread, so that when the timer
-         * fires it can be interrupted
-         */
-        currThread = Thread.currentThread();
-        timeOne.restart();
-
-        /* write a string command out to child process
-         * The command is formed by appending whether to test non-TT fonts
-         * and font path to be tested
-         */
-        String command = Integer.toString(checkNonTTF ? 1 : 0) +
-                         fontPath +
-                         System.getProperty("line.separator");
-        procPipeOut.write(command);
-        procPipeOut.flush();
-
-        /* check if underlying stream has encountered an error after
-         * command has been issued
-         */
-        if (procPipeOut.checkError()){
-            printlnMessage("Error: font crashed");
-            initialize();
-            return false;
-        }
-
-        /* trying reading error code back from child process */
-        try {
-            bytesRead = procPipeIn.read();
-        } catch(InterruptedIOException e) {
-            /* A timeout timer fired before the operation completed */
-            printlnMessage("Error: timeout occured");
-            initialize();
-            return false;
-        } catch(IOException e) {
-            /* there was an error reading from the stream */
-            timeOne.stop();
-            printlnMessage("Error: font crashed");
-            initialize();
-            return false;
-        } catch (Throwable t) {
-            bytesRead = ERR_FONT_READ_EXCPT;
-        } finally {
-          timeOne.stop();
-        }
-
-        if (bytesRead == ERR_FONT_OK) {
-            printlnMessage("Font integrity verified");
-            return true;
-        } else if (bytesRead > 0) {
-
-            switch(bytesRead){
-            case ERR_FONT_NOT_FOUND:
-                printlnMessage("Error: font not found!");
-                break;
-            case ERR_FONT_BAD_FORMAT:
-                printlnMessage("Error: incorrect font format");
-                break;
-            case ERR_FONT_READ_EXCPT:
-                printlnMessage("Error: exception reading font");
-                break;
-            case ERR_FONT_DISPLAY:
-                printlnMessage("Error: can't display characters");
-                break;
-            case ERR_FONT_CRASH:
-                printlnMessage("Error: font crashed");
-                break;
-            default:
-                printlnMessage("Error: invalid error code:"+bytesRead);
-                break;
-
-            }
-        } else if (bytesRead == ERR_FONT_EOS) {
-            printlnMessage("Error: end of stream marker encountered");
-        } else {
-            printlnMessage("Error: invalid error code:"+bytesRead);
-        }
-
-        /* if we still haven't returned from this method, some error
-         * condition has occured and it is safer to re-initialize
-         */
-        initialize();
-        return false;
-    }
-
-    /**
-     * Checks the integrity of all system fonts.
-     * <BR>
-     * This method goes through every font in system's font path and verifies
-     * its integrity via the tryFont method.
-     * <BR><BR>
-     * @param restart <code>true</code> if checking of fonts should continue
-     * after the first  bad font is found, and <code>false</code> otherwise
-     * @return returns <code>true</code> if all fonts are valid,
-     * <code>false</code> otherwise
-     * @see #tryFont(String, boolean, boolean)
-     */
-    public boolean checkFonts(boolean restart) {
-
-        /* file filter to filter out none-truetype font files */
-        FontFileFilter fff = new FontFileFilter(checkNonTTF);
-        boolean checkOk = true;
-
-        /* get platform-independent font path. Note that this bypasses
-         * the normal GraphicsEnvironment initialisation. In conjunction with
-         * the headless setting above, so we want to add
-         * java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
-         * to trigger a more normal initialisation.
-         */
-        java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
-        String fontPath = FontManager.getFontPath(true);
-        StringTokenizer st =
-            new StringTokenizer(fontPath,
-                                System.getProperty("path.separator"));
-
-        /* some systems may have multiple font paths separated by
-         * platform-dependent characters, so fontPath string needs to be
-         * parsed
-         */
-        timeOne = new javax.swing.Timer(timeoutOne, this);
-        timeAll = new javax.swing.Timer(timeoutAll, this);
-        timeAll.restart();
-        while (st.hasMoreTokens()) {
-            File fontRoot = new File(st.nextToken());
-            File[] fontFiles = fontRoot.listFiles(fff);
-
-            for (int i = 0; i < fontFiles.length; i++) {
-                /* for each font file that is not a directory and passes
-                 * through the font filter run the test
-                 */
-                if (!fontFiles[i].isDirectory() &&
-                    !tryFont(fontFiles[i])) {
-
-                    checkOk = false;
-                    badFonts.add(fontFiles[i].getAbsolutePath());
-                    if (!restart) {
-                        break;
-                    }
-                }
-            }
-        }
-
-        /* Tell the child to exit */
-        procPipeOut.write(EXITCOMMAND+System.getProperty("line.separator"));
-        procPipeOut.flush();
-        procPipeOut.close();
-
-        return checkOk;
-    }
-
-    public static void main(String args[]){
-        try {
-            /* Background app. */
-            System.setProperty("java.awt.headless", "true");
-            System.setProperty("sun.java2d.noddraw", "true");
-
-            boolean restart = true;
-            boolean errorFlag = false;
-
-            FontChecker fc = new FontChecker();
-            int arg = 0;
-
-            while (arg < args.length && errorFlag == false) {
-                if (args[arg].equals("-v")) {
-                    verbose = true;
-                }
-                else if (args[arg].equals("-w") &&
-                         System.getProperty("os.name", "unknown").
-                         startsWith("Windows")) {
-                    javaCmd = "javaw";
-                }
-                else if (args[arg].equals("-o")) {
-                    /* set output file */
-                    if (++arg < args.length)
-                        fc.outputFile = args[arg];
-                    else {
-                        /* invalid argument format */
-                        printlnMessage("Error: invalid argument format");
-                        errorFlag = true;
-                    }
-                }
-                else {
-                    /* invalid command line argument */
-                    printlnMessage("Error: invalid argument value");
-                    errorFlag = true;
-                }
-                arg++;
-            }
-
-            if (errorFlag || fc.outputFile == null) {
-                System.exit(0);
-            }
-
-            File outfile = new File(fc.outputFile);
-            if (outfile.exists()) {
-                outfile.delete();
-            }
-
-            fc.initialize();
-
-            if (!fc.checkFonts(restart)) {
-                String[] badFonts = (String[])fc.badFonts.toArray(new String[0]);
-                if (badFonts.length > 0) {
-                    printlnMessage("Bad Fonts:");
-                    try {
-                        FileOutputStream fos =
-                            new FileOutputStream(fc.outputFile);
-                        PrintStream ps = new  PrintStream(fos);
-                        for (int i = 0; i < badFonts.length; i++) {
-                            ps.println(badFonts[i]);
-                            printlnMessage(badFonts[i]);
-                        }
-                        fos.close();
-                    } catch (IOException e) {
-                    }
-                }
-            } else {
-                printlnMessage("No bad fonts found.");
-        }
-        } catch (Throwable t) {
-        }
-        System.exit(0);
-    }
-}
--- a/make/tools/src/build/tools/fontchecker/FontCheckerConstants.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright 2002-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.
- */
-
-package build.tools.fontchecker;
-
-public interface FontCheckerConstants {
-
-    /* code sent to indicate child process started OK */
-    public static final int CHILD_STARTED_OK   = 100;
-
-    /* error codes returned from child process */
-    public static final int ERR_FONT_OK         = 65;
-    public static final int ERR_FONT_NOT_FOUND  = 60;
-    public static final int ERR_FONT_BAD_FORMAT = 61;
-    public static final int ERR_FONT_READ_EXCPT = 62;
-    public static final int ERR_FONT_DISPLAY    = 64;
-    public static final int ERR_FONT_EOS        = -1;
-    /* nl char sent after child crashes */
-    public static final int ERR_FONT_CRASH      = 10;
-
-    /* 0 and 1 are reserved, and commands can only be a single digit integer */
-    public static final int EXITCOMMAND = 2;
-}
--- a/make/tools/src/build/tools/fontchecker/FontFileFilter.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright 2002-2003 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-/*
- * <PRE>
- * This class filters TrueType font files from other file
- * found in the font path.
- *
- * </PRE>
- *
- * @author Ilya Bagrak
- */
-
-package build.tools.fontchecker;
-
-import java.awt.*;
-import java.io.*;
-
-public class FontFileFilter implements java.io.FileFilter, FontCheckerConstants {
-
-    /**
-     * Boolean flag indicating whether this filter filters out
-     * non-TrueType fonts.
-     */
-    private boolean checkNonTTF;
-
-    public FontFileFilter() {
-        this(false);
-    }
-
-    public FontFileFilter(boolean checkNonTTF) {
-        super();
-        this.checkNonTTF = checkNonTTF;
-    }
-
-    /**
-     * Checks whether a file is accepted by this filter.
-     * <BR>
-     * This method checks whehter a file is accepted by this filter.
-     * This filter is made to accept all the file whose extension is
-     * either .ttf or .TTF. These files are assumed to be TrueType fonts.
-     * <BR><BR>
-     * @return returns a boolean value indicating whether or not a file is
-     * accepted
-     */
-    public boolean accept(File pathname) {
-
-        String name = pathname.getName();
-        return (name.endsWith(".ttf") ||
-                name.endsWith(".TTF") ||
-                name.endsWith(".ttc") ||
-                name.endsWith(".TTC"))  ||
-            (name.endsWith(".pfb") ||
-             name.endsWith(".PFB") ||
-             name.endsWith(".pfa") ||
-             name.endsWith(".PFA") &&
-             checkNonTTF == true);
-    }
-
-    public static int getFontType(String filename) {
-        if (filename.endsWith(".ttf") ||
-            filename.endsWith(".TTF") ||
-            filename.endsWith(".ttc") ||
-            filename.endsWith(".TTC"))
-            return Font.TRUETYPE_FONT;
-        else if (filename.endsWith(".pfb") ||
-                 filename.endsWith(".PFB") ||
-                 filename.endsWith(".pfa") ||
-                 filename.endsWith(".PFA"))
-            return Font.TYPE1_FONT;
-        else
-            return 999;
-    }
-
-}
--- a/make/tools/src/build/tools/fontchecker/README.txt	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright 2002-2003 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-Instructions for running FontChecker 
-------------------------------------
-
-FontChecker is a program designed to identify fonts that may cause JRE
-crashes. Such fonts may be corrupted files, or badly constructed fonts.
-Some crashes may also be due to bugs in the JRE's font code.
-This test is designed to run quickly and silently as part of the JRE
-installation process. It will only benefit users who install the JRE
-via that mechanism. It cannot guarantee to identify all "bad fonts" because
-the tests are minimal. Nor can it prevent problems due to fonts installed
-subsequently to the JRE's installation. However it does ensure that the
-vast majority of problem fonts are identified. This is important
-"RAS" functionality. It is targeted at the consumer/plugin market where
-there is substantial likelihood of end-users having installed software
-packages which may be delivered with fonts that are not up to commercial
-standards.
-
-The test is designed to be "fail safe". If the program fails to run
-properly it has no impact on the installer or on JRE execution.
-Thus there is no need to monitor successful execution of the test.
-
-The test is not a new "tool" in the sense of "javah" etc.
-The test is not designed to be user executable or visible, and should
-be unpacked by the installer into a temporary location, and executed
-once the rest of the JRE is installed (ie as a postinstall step), and
-can then be deleted from the temporary location once installation is
-complete. Not deleting the jar file before execution is complete is
-probably the sole reason that the installer may want to wait for
-the program to complete.
-
-The FontChecker application can be run directly from the jar 
-file with this command: 
-	%java -jar fontchecker.jar -o <file>
-
-The output file is a required parameter in this version of the application.
-The JRE installer should use the above form, and use it to create an
-output file which must be named "badfonts.txt" and be placed into
-the JRE's lib\fonts directory eg:-
-
-        java -jar fontchecker.jar -o "C:\Program Files\jre\lib\fonts\badfonts.txt"
-
-Note the lower case "badfonts.txt", and the string quotes because of the spaces
-in the path name.
-The location given here is an example and needs to be calculated at install
-time as $JREHOME\lib\fonts\badfonts.txt
-The location and name are important, because the JRE at runtime will
-look for this exactly located name and file.
-This location is private to that JRE instance. It will not affect
-any other JRE installed on the system.
-
-If running from a different directory than that containing the jar file,
-use the form containing the full path to the jar file, eg :
-
-	java -jar C:\fc\fontchecker.jar -o "C:\Program Files\jre\lib\fonts\badfonts.txt"
-
-FontChecker application accepts following command line flags. 
-usage: java -jar fontchecker.jar -o outputfile
-	                -v 
-
-       -o is the name of the file to contains canonical path names of
-          bad fonts that are identified. This file is not created if
-          no bad fonts are found.
-
-       -v verbose mode: print progress/warning messages. Not recommended
-         for installer use.
-
-       -w if running on Windows, use "javaw" to exec the sub-process.
--- a/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java	Wed Nov 25 22:14:30 2009 -0800
@@ -62,6 +62,8 @@
 
 import java.io.*;
 import java.nio.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.StringTokenizer;
@@ -502,12 +504,18 @@
             iis.reset();
 
             try {
-                if (metadata.colorSpace == PROFILE_LINKED)
+                if (metadata.colorSpace == PROFILE_LINKED &&
+                    isLinkedProfileAllowed() &&
+                    !isUncOrDevicePath(profile))
+                {
+                    String path = new String(profile, "windows-1252");
+
                     colorSpace =
-                        new ICC_ColorSpace(ICC_Profile.getInstance(new String(profile)));
-                else
+                        new ICC_ColorSpace(ICC_Profile.getInstance(path));
+                } else {
                     colorSpace =
                         new ICC_ColorSpace(ICC_Profile.getInstance(profile));
+                }
             } catch (Exception e) {
                 colorSpace = ColorSpace.getInstance(ColorSpace.CS_sRGB);
             }
@@ -1745,4 +1753,69 @@
         public void sequenceStarted(ImageReader src, int minIndex) {}
         public void readAborted(ImageReader src) {}
     }
+
+    private static Boolean isLinkedProfileDisabled = null;
+
+    private static boolean isLinkedProfileAllowed() {
+        if (isLinkedProfileDisabled == null) {
+            PrivilegedAction<Boolean> a = new PrivilegedAction<Boolean>() {
+                public Boolean run() {
+                    return Boolean.getBoolean("sun.imageio.plugins.bmp.disableLinkedProfiles");
+                }
+            };
+            isLinkedProfileDisabled = AccessController.doPrivileged(a);
+        }
+        return !isLinkedProfileDisabled;
+    }
+
+    private static Boolean isWindowsPlatform = null;
+
+    /**
+     * Verifies whether the byte array contans a unc path.
+     * Non-UNC path examples:
+     *  c:\path\to\file  - simple notation
+     *  \\?\c:\path\to\file - long notation
+     *
+     * UNC path examples:
+     *  \\server\share - a UNC path in simple notation
+     *  \\?\UNC\server\share - a UNC path in long notation
+     *  \\.\some\device - a path to device.
+     */
+    private static boolean isUncOrDevicePath(byte[] p) {
+        if (isWindowsPlatform == null) {
+            PrivilegedAction<Boolean> a = new PrivilegedAction<Boolean>() {
+                public Boolean run() {
+                    String osname = System.getProperty("os.name");
+                    return (osname != null &&
+                            osname.toLowerCase().startsWith("win"));
+                }
+            };
+            isWindowsPlatform = AccessController.doPrivileged(a);
+        }
+
+        if (!isWindowsPlatform) {
+            /* no need for the check on platforms except windows */
+            return false;
+        }
+
+        /* normalize prefix of the path */
+        if (p[0] == '/') p[0] = '\\';
+        if (p[1] == '/') p[1] = '\\';
+        if (p[3] == '/') p[3] = '\\';
+
+
+        if ((p[0] == '\\') && (p[1] == '\\')) {
+            if ((p[2] == '?') && (p[3] == '\\')) {
+                // long path: whether unc or local
+                return ((p[4] == 'U' || p[4] == 'u') &&
+                        (p[5] == 'N' || p[5] == 'n') &&
+                        (p[6] == 'C' || p[6] == 'c'));
+            } else {
+                // device path or short unc notation
+                return true;
+            }
+        } else {
+            return false;
+        }
+    }
 }
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifButtonUI.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifButtonUI.java	Wed Nov 25 22:14:30 2009 -0800
@@ -25,6 +25,8 @@
 
 package com.sun.java.swing.plaf.motif;
 
+import sun.awt.AppContext;
+
 import javax.swing.*;
 import javax.swing.border.*;
 import javax.swing.plaf.basic.*;
@@ -46,16 +48,23 @@
  */
 public class MotifButtonUI extends BasicButtonUI {
 
-    private final static MotifButtonUI motifButtonUI = new MotifButtonUI();
-
     protected Color selectColor;
 
     private boolean defaults_initialized = false;
 
+    private static final Object MOTIF_BUTTON_UI_KEY = new Object();
+
     // ********************************
     //          Create PLAF
     // ********************************
-    public static ComponentUI createUI(JComponent c){
+    public static ComponentUI createUI(JComponent c) {
+        AppContext appContext = AppContext.getAppContext();
+        MotifButtonUI motifButtonUI =
+                (MotifButtonUI) appContext.get(MOTIF_BUTTON_UI_KEY);
+        if (motifButtonUI == null) {
+            motifButtonUI = new MotifButtonUI();
+            appContext.put(MOTIF_BUTTON_UI_KEY, motifButtonUI);
+        }
         return motifButtonUI;
     }
 
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxUI.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifCheckBoxUI.java	Wed Nov 25 22:14:30 2009 -0800
@@ -25,6 +25,8 @@
 
 package com.sun.java.swing.plaf.motif;
 
+import sun.awt.AppContext;
+
 import javax.swing.*;
 
 import javax.swing.plaf.*;
@@ -45,7 +47,7 @@
  */
 public class MotifCheckBoxUI extends MotifRadioButtonUI {
 
-    private static final MotifCheckBoxUI motifCheckBoxUI = new MotifCheckBoxUI();
+    private static final Object MOTIF_CHECK_BOX_UI_KEY = new Object();
 
     private final static String propertyPrefix = "CheckBox" + ".";
 
@@ -55,7 +57,14 @@
     // ********************************
     //         Create PLAF
     // ********************************
-    public static ComponentUI createUI(JComponent c){
+    public static ComponentUI createUI(JComponent c) {
+        AppContext appContext = AppContext.getAppContext();
+        MotifCheckBoxUI motifCheckBoxUI =
+                (MotifCheckBoxUI) appContext.get(MOTIF_CHECK_BOX_UI_KEY);
+        if (motifCheckBoxUI == null) {
+            motifCheckBoxUI = new MotifCheckBoxUI();
+            appContext.put(MOTIF_CHECK_BOX_UI_KEY, motifCheckBoxUI);
+        }
         return motifCheckBoxUI;
     }
 
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifLabelUI.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifLabelUI.java	Wed Nov 25 22:14:30 2009 -0800
@@ -25,6 +25,8 @@
 
 package com.sun.java.swing.plaf.motif;
 
+import sun.awt.AppContext;
+
 import javax.swing.*;
 import javax.swing.plaf.basic.BasicLabelUI;
 import javax.swing.plaf.ComponentUI;
@@ -44,9 +46,16 @@
  */
 public class MotifLabelUI extends BasicLabelUI
 {
-    static MotifLabelUI sharedInstance = new MotifLabelUI();
+    private static final Object MOTIF_LABEL_UI_KEY = new Object();
 
     public static ComponentUI createUI(JComponent c) {
-        return sharedInstance;
+        AppContext appContext = AppContext.getAppContext();
+        MotifLabelUI motifLabelUI =
+                (MotifLabelUI) appContext.get(MOTIF_LABEL_UI_KEY);
+        if (motifLabelUI == null) {
+            motifLabelUI = new MotifLabelUI();
+            appContext.put(MOTIF_LABEL_UI_KEY, motifLabelUI);
+        }
+        return motifLabelUI;
     }
 }
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonUI.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifRadioButtonUI.java	Wed Nov 25 22:14:30 2009 -0800
@@ -25,6 +25,8 @@
 
 package com.sun.java.swing.plaf.motif;
 
+import sun.awt.AppContext;
+
 import javax.swing.*;
 import javax.swing.border.*;
 import javax.swing.plaf.basic.BasicRadioButtonUI;
@@ -47,7 +49,7 @@
  */
 public class MotifRadioButtonUI extends BasicRadioButtonUI {
 
-    private static final MotifRadioButtonUI motifRadioButtonUI = new MotifRadioButtonUI();
+    private static final Object MOTIF_RADIO_BUTTON_UI_KEY = new Object();
 
     protected Color focusColor;
 
@@ -57,6 +59,13 @@
     //         Create PLAF
     // ********************************
     public static ComponentUI createUI(JComponent c) {
+        AppContext appContext = AppContext.getAppContext();
+        MotifRadioButtonUI motifRadioButtonUI =
+                (MotifRadioButtonUI) appContext.get(MOTIF_RADIO_BUTTON_UI_KEY);
+        if (motifRadioButtonUI == null) {
+            motifRadioButtonUI = new MotifRadioButtonUI();
+            appContext.put(MOTIF_RADIO_BUTTON_UI_KEY, motifRadioButtonUI);
+        }
         return motifRadioButtonUI;
     }
 
--- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifToggleButtonUI.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifToggleButtonUI.java	Wed Nov 25 22:14:30 2009 -0800
@@ -25,6 +25,8 @@
 
 package com.sun.java.swing.plaf.motif;
 
+import sun.awt.AppContext;
+
 import java.awt.*;
 import java.awt.event.*;
 
@@ -48,7 +50,7 @@
  */
 public class MotifToggleButtonUI extends BasicToggleButtonUI
 {
-    private final static MotifToggleButtonUI motifToggleButtonUI = new MotifToggleButtonUI();
+    private static final Object MOTIF_TOGGLE_BUTTON_UI_KEY = new Object();
 
     protected Color selectColor;
 
@@ -58,6 +60,13 @@
     //         Create PLAF
     // ********************************
     public static ComponentUI createUI(JComponent b) {
+        AppContext appContext = AppContext.getAppContext();
+        MotifToggleButtonUI motifToggleButtonUI =
+                (MotifToggleButtonUI) appContext.get(MOTIF_TOGGLE_BUTTON_UI_KEY);
+        if (motifToggleButtonUI == null) {
+            motifToggleButtonUI = new MotifToggleButtonUI();
+            appContext.put(MOTIF_TOGGLE_BUTTON_UI_KEY, motifToggleButtonUI);
+        }
         return motifToggleButtonUI;
     }
 
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsButtonUI.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsButtonUI.java	Wed Nov 25 22:14:30 2009 -0800
@@ -35,6 +35,7 @@
 import static com.sun.java.swing.plaf.windows.TMSchema.*;
 import static com.sun.java.swing.plaf.windows.TMSchema.Part.*;
 import static com.sun.java.swing.plaf.windows.XPStyle.Skin;
+import sun.awt.AppContext;
 
 
 /**
@@ -52,8 +53,6 @@
  */
 public class WindowsButtonUI extends BasicButtonUI
 {
-    private final static WindowsButtonUI windowsButtonUI = new WindowsButtonUI();
-
     protected int dashedRectGapX;
     protected int dashedRectGapY;
     protected int dashedRectGapWidth;
@@ -63,11 +62,19 @@
 
     private boolean defaults_initialized = false;
 
+    private static final Object WINDOWS_BUTTON_UI_KEY = new Object();
 
     // ********************************
     //          Create PLAF
     // ********************************
-    public static ComponentUI createUI(JComponent c){
+    public static ComponentUI createUI(JComponent c) {
+        AppContext appContext = AppContext.getAppContext();
+        WindowsButtonUI windowsButtonUI =
+                (WindowsButtonUI) appContext.get(WINDOWS_BUTTON_UI_KEY);
+        if (windowsButtonUI == null) {
+            windowsButtonUI = new WindowsButtonUI();
+            appContext.put(WINDOWS_BUTTON_UI_KEY, windowsButtonUI);
+        }
         return windowsButtonUI;
     }
 
@@ -151,7 +158,7 @@
      * allocating them in each paint call substantially reduced the time
      * it took paint to run.  Obviously, this method can't be re-entered.
      */
-    private static Rectangle viewRect = new Rectangle();
+    private Rectangle viewRect = new Rectangle();
 
     public void paint(Graphics g, JComponent c) {
         if (XPStyle.getXP() != null) {
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxUI.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxUI.java	Wed Nov 25 22:14:30 2009 -0800
@@ -25,6 +25,8 @@
 
 package com.sun.java.swing.plaf.windows;
 
+import sun.awt.AppContext;
+
 import javax.swing.plaf.basic.*;
 import javax.swing.*;
 import javax.swing.plaf.*;
@@ -49,7 +51,7 @@
     // of BasicCheckBoxUI because we want to pick up all the
     // painting changes made in MetalRadioButtonUI.
 
-    private static final WindowsCheckBoxUI windowsCheckBoxUI = new WindowsCheckBoxUI();
+    private static final Object WINDOWS_CHECK_BOX_UI_KEY = new Object();
 
     private final static String propertyPrefix = "CheckBox" + ".";
 
@@ -59,6 +61,13 @@
     //          Create PLAF
     // ********************************
     public static ComponentUI createUI(JComponent c) {
+        AppContext appContext = AppContext.getAppContext();
+        WindowsCheckBoxUI windowsCheckBoxUI =
+                (WindowsCheckBoxUI) appContext.get(WINDOWS_CHECK_BOX_UI_KEY);
+        if (windowsCheckBoxUI == null) {
+            windowsCheckBoxUI = new WindowsCheckBoxUI();
+            appContext.put(WINDOWS_CHECK_BOX_UI_KEY, windowsCheckBoxUI);
+        }
         return windowsCheckBoxUI;
     }
 
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLabelUI.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLabelUI.java	Wed Nov 25 22:14:30 2009 -0800
@@ -26,6 +26,8 @@
 package com.sun.java.swing.plaf.windows;
 
 import sun.swing.SwingUtilities2;
+import sun.awt.AppContext;
+
 import java.awt.Color;
 import java.awt.Graphics;
 
@@ -51,12 +53,19 @@
  */
 public class WindowsLabelUI extends BasicLabelUI {
 
-    private final static WindowsLabelUI windowsLabelUI = new WindowsLabelUI();
+    private static final Object WINDOWS_LABEL_UI_KEY = new Object();
 
     // ********************************
     //          Create PLAF
     // ********************************
-    public static ComponentUI createUI(JComponent c){
+    public static ComponentUI createUI(JComponent c) {
+        AppContext appContext = AppContext.getAppContext();
+        WindowsLabelUI windowsLabelUI =
+                (WindowsLabelUI) appContext.get(WINDOWS_LABEL_UI_KEY);
+        if (windowsLabelUI == null) {
+            windowsLabelUI = new WindowsLabelUI();
+            appContext.put(WINDOWS_LABEL_UI_KEY, windowsLabelUI);
+        }
         return windowsLabelUI;
     }
 
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonUI.java	Wed Nov 25 22:14:30 2009 -0800
@@ -25,6 +25,8 @@
 
 package com.sun.java.swing.plaf.windows;
 
+import sun.awt.AppContext;
+
 import javax.swing.plaf.basic.*;
 import javax.swing.*;
 import javax.swing.plaf.*;
@@ -44,7 +46,7 @@
  */
 public class WindowsRadioButtonUI extends BasicRadioButtonUI
 {
-    private static final WindowsRadioButtonUI windowsRadioButtonUI = new WindowsRadioButtonUI();
+    private static final Object WINDOWS_RADIO_BUTTON_UI_KEY = new Object();
 
     protected int dashedRectGapX;
     protected int dashedRectGapY;
@@ -59,6 +61,13 @@
     //          Create PLAF
     // ********************************
     public static ComponentUI createUI(JComponent c) {
+        AppContext appContext = AppContext.getAppContext();
+        WindowsRadioButtonUI windowsRadioButtonUI =
+                (WindowsRadioButtonUI) appContext.get(WINDOWS_RADIO_BUTTON_UI_KEY);
+        if (windowsRadioButtonUI == null) {
+            windowsRadioButtonUI = new WindowsRadioButtonUI();
+            appContext.put(WINDOWS_RADIO_BUTTON_UI_KEY, windowsRadioButtonUI);
+        }
         return windowsRadioButtonUI;
     }
 
--- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsToggleButtonUI.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsToggleButtonUI.java	Wed Nov 25 22:14:30 2009 -0800
@@ -25,6 +25,8 @@
 
 package com.sun.java.swing.plaf.windows;
 
+import sun.awt.AppContext;
+
 import javax.swing.plaf.basic.*;
 import javax.swing.border.*;
 import javax.swing.plaf.*;
@@ -49,18 +51,25 @@
  */
 public class WindowsToggleButtonUI extends BasicToggleButtonUI
 {
-    protected static int dashedRectGapX;
-    protected static int dashedRectGapY;
-    protected static int dashedRectGapWidth;
-    protected static int dashedRectGapHeight;
+    protected int dashedRectGapX;
+    protected int dashedRectGapY;
+    protected int dashedRectGapWidth;
+    protected int dashedRectGapHeight;
 
     protected Color focusColor;
 
-    private final static WindowsToggleButtonUI windowsToggleButtonUI = new WindowsToggleButtonUI();
+    private static final Object WINDOWS_TOGGLE_BUTTON_UI_KEY = new Object();
 
     private boolean defaults_initialized = false;
 
     public static ComponentUI createUI(JComponent b) {
+        AppContext appContext = AppContext.getAppContext();
+        WindowsToggleButtonUI windowsToggleButtonUI =
+                (WindowsToggleButtonUI) appContext.get(WINDOWS_TOGGLE_BUTTON_UI_KEY);
+        if (windowsToggleButtonUI == null) {
+            windowsToggleButtonUI = new WindowsToggleButtonUI();
+            appContext.put(WINDOWS_TOGGLE_BUTTON_UI_KEY, windowsToggleButtonUI);
+        }
         return windowsToggleButtonUI;
     }
 
--- a/src/share/classes/com/sun/jmx/defaults/JmxProperties.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/jmx/defaults/JmxProperties.java	Wed Nov 25 22:14:30 2009 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2008 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
@@ -177,18 +177,6 @@
             "javax.management.relation";
 
     /**
-     * Logger name for Namespaces.
-     */
-    public static final String NAMESPACE_LOGGER_NAME =
-            "javax.management.namespace";
-
-     /**
-     * Logger name for Namespaces.
-     */
-    public static final Logger NAMESPACE_LOGGER =
-            Logger.getLogger(NAMESPACE_LOGGER_NAME);
-
-    /**
      * Logger for Relation Service.
      */
     public static final Logger RELATION_LOGGER =
--- a/src/share/classes/com/sun/jmx/defaults/ServiceName.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/jmx/defaults/ServiceName.java	Wed Nov 25 22:14:30 2009 -0800
@@ -69,9 +69,9 @@
     /**
      * The version of the JMX specification implemented by this product.
      * <BR>
-     * The value is <CODE>2.0</CODE>.
+     * The value is <CODE>1.4</CODE>.
      */
-    public static final String JMX_SPEC_VERSION = "2.0";
+    public static final String JMX_SPEC_VERSION = "1.4";
 
     /**
      * The vendor of the JMX specification implemented by this product.
--- a/src/share/classes/com/sun/jmx/event/DaemonThreadFactory.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
- * Copyright 2007-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 com.sun.jmx.event;
-
-import com.sun.jmx.remote.util.ClassLogger;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.atomic.AtomicInteger;
-
-public class DaemonThreadFactory implements ThreadFactory {
-    public DaemonThreadFactory(String nameTemplate) {
-        this(nameTemplate, null);
-    }
-
-    // nameTemplate should be a format with %d in it, which will be replaced
-    // by a sequence number of threads created by this factory.
-    public DaemonThreadFactory(String nameTemplate, ThreadGroup threadGroup) {
-        if (logger.debugOn()) {
-            logger.debug("DaemonThreadFactory",
-                    "Construct a new daemon factory: "+nameTemplate);
-        }
-
-        if (threadGroup == null) {
-            SecurityManager s = System.getSecurityManager();
-            threadGroup = (s != null) ? s.getThreadGroup() :
-                                  Thread.currentThread().getThreadGroup();
-        }
-
-        this.nameTemplate = nameTemplate;
-        this.threadGroup = threadGroup;
-    }
-
-    public Thread newThread(Runnable r) {
-        final String name =
-                String.format(nameTemplate, threadNumber.getAndIncrement());
-        Thread t = new Thread(threadGroup, r, name, 0);
-        t.setDaemon(true);
-        if (t.getPriority() != Thread.NORM_PRIORITY)
-            t.setPriority(Thread.NORM_PRIORITY);
-
-        if (logger.debugOn()) {
-            logger.debug("newThread",
-                    "Create a new daemon thread with the name "+t.getName());
-        }
-
-        return t;
-    }
-
-    private final String nameTemplate;
-    private final ThreadGroup threadGroup;
-    private final AtomicInteger threadNumber = new AtomicInteger(1);
-
-    private static final ClassLogger logger =
-        new ClassLogger("com.sun.jmx.event", "DaemonThreadFactory");
-}
--- a/src/share/classes/com/sun/jmx/event/EventBuffer.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,252 +0,0 @@
-/*
- * Copyright 2007-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 com.sun.jmx.event;
-
-import com.sun.jmx.remote.util.ClassLogger;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import javax.management.remote.NotificationResult;
-import javax.management.remote.TargetedNotification;
-
-public class EventBuffer {
-
-    public EventBuffer() {
-        this(Integer.MAX_VALUE, null);
-    }
-
-    public EventBuffer(int capacity) {
-        this(capacity, new ArrayList<TargetedNotification>());
-    }
-
-    public EventBuffer(int capacity, final List<TargetedNotification> list) {
-        if (logger.traceOn()) {
-            logger.trace("EventBuffer", "New buffer with the capacity: "
-                    +capacity);
-        }
-        if (capacity < 1) {
-            throw new IllegalArgumentException(
-                    "The capacity must be bigger than 0");
-        }
-
-        if (list == null) {
-            throw new NullPointerException("Null list.");
-        }
-
-        this.capacity = capacity;
-        this.list = list;
-    }
-
-    public void add(TargetedNotification tn) {
-        if (logger.traceOn()) {
-            logger.trace("add", "Add one notif.");
-        }
-
-        synchronized(lock) {
-            if (list.size() == capacity) { // have to throw one
-                passed++;
-                list.remove(0);
-
-                if (logger.traceOn()) {
-                    logger.trace("add", "Over, remove the oldest one.");
-                }
-            }
-
-            list.add(tn);
-            lock.notify();
-        }
-    }
-
-    public void add(TargetedNotification[] tns) {
-        if (tns == null || tns.length == 0) {
-            return;
-        }
-
-        if (logger.traceOn()) {
-            logger.trace("add", "Add notifs: "+tns.length);
-        }
-
-        synchronized(lock) {
-            final int d = list.size() - capacity + tns.length;
-            if (d > 0) { // have to throw
-                passed += d;
-                if (logger.traceOn()) {
-                    logger.trace("add",
-                            "Over, remove the oldest: "+d);
-                }
-                if (tns.length <= capacity){
-                    list.subList(0, d).clear();
-                } else {
-                    list.clear();
-                    TargetedNotification[] tmp =
-                            new TargetedNotification[capacity];
-                    System.arraycopy(tns, tns.length-capacity, tmp, 0, capacity);
-                    tns = tmp;
-                }
-            }
-
-            Collections.addAll(list,tns);
-            lock.notify();
-        }
-    }
-
-    public NotificationResult fetchNotifications(long startSequenceNumber,
-            long timeout,
-            int maxNotifications) {
-        if (logger.traceOn()) {
-            logger.trace("fetchNotifications",
-                    "Being called: "
-                    +startSequenceNumber+" "
-                    +timeout+" "+maxNotifications);
-        }
-        if (startSequenceNumber < 0 ||
-                timeout < 0 ||
-                maxNotifications < 0) {
-            throw new IllegalArgumentException("Negative value.");
-        }
-
-        TargetedNotification[] tns = new TargetedNotification[0];
-        long earliest = startSequenceNumber < passed ?
-            passed : startSequenceNumber;
-        long next = earliest;
-
-        final long startTime = System.currentTimeMillis();
-        long toWait = timeout;
-        synchronized(lock) {
-            int toSkip = (int)(startSequenceNumber - passed);
-
-            // skip those before startSequenceNumber.
-            while (!closed && toSkip > 0) {
-                toWait = timeout - (System.currentTimeMillis() - startTime);
-                if (list.size() == 0) {
-                    if (toWait <= 0) {
-                        // the notification of startSequenceNumber
-                        // does not arrive yet.
-                        return new NotificationResult(startSequenceNumber,
-                                startSequenceNumber,
-                                new TargetedNotification[0]);
-                    }
-
-                    waiting(toWait);
-                    continue;
-                }
-
-                if (toSkip <= list.size()) {
-                    list.subList(0, toSkip).clear();
-                    passed += toSkip;
-
-                    break;
-                } else {
-                    passed += list.size();
-                    toSkip -= list.size();
-
-                    list.clear();
-                }
-            }
-
-            earliest = passed;
-
-            if (list.size() == 0) {
-                toWait = timeout - (System.currentTimeMillis() - startTime);
-
-                waiting(toWait);
-            }
-
-            if (list.size() == 0) {
-                tns = new TargetedNotification[0];
-            } else if (list.size() <= maxNotifications) {
-                tns = list.toArray(new TargetedNotification[0]);
-            } else {
-                tns = new TargetedNotification[maxNotifications];
-                for (int i=0; i<maxNotifications; i++) {
-                    tns[i] = list.get(i);
-                }
-            }
-
-            next = earliest + tns.length;
-        }
-
-        if (logger.traceOn()) {
-            logger.trace("fetchNotifications",
-                    "Return: "+earliest+" "+next+" "+tns.length);
-        }
-
-        return new NotificationResult(earliest, next, tns);
-    }
-
-    public int size() {
-        return list.size();
-    }
-
-    public void addLost(long nb) {
-        synchronized(lock) {
-            passed += nb;
-        }
-    }
-
-    public void close() {
-        if (logger.traceOn()) {
-            logger.trace("clear", "done");
-        }
-
-        synchronized(lock) {
-            list.clear();
-            closed = true;
-            lock.notifyAll();
-        }
-    }
-
-
-    // -------------------------------------------
-    // private classes
-    // -------------------------------------------
-    private void waiting(long timeout) {
-        final long startTime = System.currentTimeMillis();
-        long toWait = timeout;
-        synchronized(lock) {
-            while (!closed && list.size() == 0 && toWait > 0) {
-                try {
-                    lock.wait(toWait);
-
-                    toWait = timeout - (System.currentTimeMillis() - startTime);
-                } catch (InterruptedException ire) {
-                    logger.trace("waiting", ire);
-                    break;
-                }
-            }
-        }
-    }
-
-    private final int capacity;
-    private final List<TargetedNotification> list;
-    private boolean closed;
-
-    private long passed = 0;
-    private final int[] lock = new int[0];
-
-    private static final ClassLogger logger =
-            new ClassLogger("javax.management.event", "EventBuffer");
-}
--- a/src/share/classes/com/sun/jmx/event/EventClientFactory.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright 2007-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 com.sun.jmx.event;
-
-import javax.management.event.*;
-
-/**
- * Implemented by objects which are using an {@link EventClient} to
- * subscribe for Notifications.
- *
- */
-public interface EventClientFactory {
-    /**
-     * Returns the {@code EventClient} that the object implementing this
-     * interface uses to subscribe for Notifications. This method returns
-     * {@code null} if no {@code EventClient} can be used - e.g. because
-     * the underlying server does not have any {@link EventDelegate}.
-     *
-     * @return an {@code EventClient} or {@code null}.
-     **/
-    public EventClient getEventClient();
-
-}
--- a/src/share/classes/com/sun/jmx/event/EventConnection.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
- * Copyright 2002-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 com.sun.jmx.event;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import javax.management.MBeanServerConnection;
-import javax.management.event.EventClient;
-import javax.management.event.EventClientDelegate;
-import javax.management.event.EventConsumer;
-import javax.management.event.NotificationManager;
-
-/**
- * Override the methods related to the notification to use the
- * Event service.
- */
-public interface EventConnection extends MBeanServerConnection, EventConsumer {
-    public EventClient getEventClient();
-
-    public static class Factory {
-        public static EventConnection make(
-                final MBeanServerConnection mbsc,
-                final EventClient eventClient)
-                throws IOException {
-            if (!mbsc.isRegistered(EventClientDelegate.OBJECT_NAME)) {
-                throw new IOException(
-                        "The server does not support the event service.");
-            }
-            InvocationHandler ih = new InvocationHandler() {
-                public Object invoke(Object proxy, Method method, Object[] args)
-                        throws Throwable {
-                    Class<?> intf = method.getDeclaringClass();
-                    try {
-                        if (intf.isInstance(eventClient))
-                            return method.invoke(eventClient, args);
-                        else
-                            return method.invoke(mbsc, args);
-                    } catch (InvocationTargetException e) {
-                        throw e.getCause();
-                    }
-                }
-            };
-            // It is important to declare NotificationManager.class first
-            // in the array below, so that the relevant addNL and removeNL
-            // methods will show up with method.getDeclaringClass() as
-            // being from that interface and not MBeanServerConnection.
-            return (EventConnection) Proxy.newProxyInstance(
-                    NotificationManager.class.getClassLoader(),
-                    new Class<?>[] {
-                        NotificationManager.class, EventConnection.class,
-                    },
-                    ih);
-        }
-    }
-}
--- a/src/share/classes/com/sun/jmx/event/EventParams.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright 2007-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 com.sun.jmx.event;
-
-import com.sun.jmx.mbeanserver.GetPropertyAction;
-import com.sun.jmx.remote.util.ClassLogger;
-import java.security.AccessController;
-import javax.management.event.EventClient;
-
-/**
- *
- * @author sjiang
- */
-public class EventParams {
-    public static final String DEFAULT_LEASE_TIMEOUT =
-            "com.sun.event.lease.time";
-
-
-    @SuppressWarnings("cast") // cast for jdk 1.5
-    public static long getLeaseTimeout() {
-        long timeout = EventClient.DEFAULT_REQUESTED_LEASE_TIME;
-        try {
-            final GetPropertyAction act =
-                  new GetPropertyAction(DEFAULT_LEASE_TIMEOUT);
-            final String s = (String)AccessController.doPrivileged(act);
-            if (s != null) {
-                timeout = Long.parseLong(s);
-            }
-        } catch (RuntimeException e) {
-            logger.fine("getLeaseTimeout", "exception getting property", e);
-        }
-
-        return timeout;
-    }
-
-    /** Creates a new instance of EventParams */
-    private EventParams() {
-    }
-
-    private static final ClassLogger logger =
-            new ClassLogger("javax.management.event", "EventParams");
-}
--- a/src/share/classes/com/sun/jmx/event/LeaseManager.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
- * Copyright 2007-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 com.sun.jmx.event;
-
-import com.sun.jmx.remote.util.ClassLogger;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-
-/**
- * <p>Manage a renewable lease.  The lease can be renewed indefinitely
- * but if the lease runs to its current expiry date without being renewed
- * then the expiry callback is invoked.  If the lease has already expired
- * when renewal is attempted then the lease method returns zero.</p>
- * @author sjiang
- * @author emcmanus
- */
-// The synchronization logic of this class is tricky to deal correctly with the
-// case where the lease expires at the same time as the |lease| or |stop| method
-// is called.  If the lease is active then the field |scheduled| represents
-// the expiry task; otherwise |scheduled| is null.  Renewing or stopping the
-// lease involves canceling this task and setting |scheduled| either to a new
-// task (to renew) or to null (to stop).
-//
-// Suppose the expiry task runs at the same time as the |lease| method is called.
-// If the task enters its synchronized block before the method starts, then
-// it will set |scheduled| to null and the method will return 0.  If the method
-// starts before the task enters its synchronized block, then the method will
-// cancel the task which will see that when it later enters the block.
-// Similar reasoning applies to the |stop| method.  It is not expected that
-// different threads will call |lease| or |stop| simultaneously, although the
-// logic should be correct then too.
-public class LeaseManager {
-    public LeaseManager(Runnable callback) {
-        this(callback, EventParams.getLeaseTimeout());
-    }
-
-    public LeaseManager(Runnable callback, long timeout) {
-        if (logger.traceOn()) {
-            logger.trace("LeaseManager", "new manager with lease: "+timeout);
-        }
-        if (callback == null) {
-            throw new NullPointerException("Null callback.");
-        }
-        if (timeout <= 0)
-            throw new IllegalArgumentException("Timeout must be positive: " + timeout);
-
-        this.callback = callback;
-        schedule(timeout);
-    }
-
-    /**
-     * <p>Renew the lease for the given time.  The new time can be shorter
-     * than the previous one, in which case the lease will expire earlier
-     * than it would have.</p>
-     *
-     * <p>Calling this method after the lease has expired will return zero
-     * immediately and have no other effect.</p>
-     *
-     * @param timeout the new lifetime.  If zero, the lease
-     * will expire immediately.
-     */
-    public synchronized long lease(long timeout) {
-        if (logger.traceOn()) {
-            logger.trace("lease", "new lease to: "+timeout);
-        }
-
-        if (timeout < 0)
-            throw new IllegalArgumentException("Negative lease: " + timeout);
-
-        if (scheduled == null)
-            return 0L;
-
-        scheduled.cancel(false);
-
-        if (logger.traceOn())
-            logger.trace("lease", "start lease: "+timeout);
-        schedule(timeout);
-
-        return timeout;
-    }
-
-    private class Expire implements Runnable {
-        ScheduledFuture<?> task;
-
-        public void run() {
-            synchronized (LeaseManager.this) {
-                if (task.isCancelled())
-                    return;
-                scheduled = null;
-            }
-            callback.run();
-            executor.shutdown();
-        }
-    }
-
-    private synchronized void schedule(long timeout) {
-        Expire expire = new Expire();
-        scheduled = executor.schedule(expire, timeout, TimeUnit.MILLISECONDS);
-        expire.task = scheduled;
-    }
-
-    /**
-     * <p>Cancel the lease without calling the expiry callback.</p>
-     */
-    public synchronized void stop() {
-        logger.trace("stop", "canceling lease");
-        scheduled.cancel(false);
-        scheduled = null;
-        try {
-            executor.shutdown();
-        } catch (SecurityException e) {
-            // OK: caller doesn't have RuntimePermission("modifyThread")
-            // which is unlikely in reality but triggers a test failure otherwise
-            logger.trace("stop", "exception from executor.shutdown", e);
-        }
-    }
-
-    private final Runnable callback;
-    private ScheduledFuture<?> scheduled;  // If null, the lease has expired.
-
-    private static final ThreadFactory threadFactory =
-            new DaemonThreadFactory("JMX LeaseManager %d");
-    private final ScheduledExecutorService executor
-            = Executors.newScheduledThreadPool(1, threadFactory);
-
-    private static final ClassLogger logger =
-            new ClassLogger("javax.management.event", "LeaseManager");
-
-}
--- a/src/share/classes/com/sun/jmx/event/LeaseRenewer.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
- * Copyright 2007-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 com.sun.jmx.event;
-
-import com.sun.jmx.remote.util.ClassLogger;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
-/**
- *
- * @author sjiang
- */
-public class LeaseRenewer {
-    public LeaseRenewer(ScheduledExecutorService scheduler, Callable<Long> doRenew) {
-        if (logger.traceOn()) {
-            logger.trace("LeaseRenewer", "New LeaseRenewer.");
-        }
-
-        if (doRenew == null) {
-            throw new NullPointerException("Null job to call server.");
-        }
-
-        this.doRenew = doRenew;
-        nextRenewTime = System.currentTimeMillis();
-
-        this.scheduler = scheduler;
-        future = this.scheduler.schedule(myRenew, 0, TimeUnit.MILLISECONDS);
-    }
-
-    public void close() {
-        if (logger.traceOn()) {
-            logger.trace("close", "Close the lease.");
-        }
-
-        synchronized(lock) {
-            if (closed) {
-                return;
-            } else {
-                closed = true;
-            }
-        }
-
-        try {
-            future.cancel(false); // not interrupt if running
-        } catch (Exception e) {
-            // OK
-            if (logger.debugOn()) {
-                logger.debug("close", "Failed to cancel the leasing job.", e);
-            }
-        }
-    }
-
-    public boolean closed() {
-        synchronized(lock) {
-            return closed;
-        }
-    }
-
-    // ------------------------------
-    // private
-    // ------------------------------
-    private final Runnable myRenew = new Runnable() {
-        public void run() {
-            synchronized(lock) {
-                if (closed()) {
-                    return;
-                }
-            }
-
-            long next = nextRenewTime - System.currentTimeMillis();
-            if (next < MIN_MILLIS) {
-                try {
-                    if (logger.traceOn()) {
-                        logger.trace("myRenew-run", "");
-                    }
-                    next = doRenew.call().longValue();
-
-                } catch (Exception e) {
-                    logger.fine("myRenew-run", "Failed to renew lease", e);
-                    close();
-                }
-
-                if (next > 0 && next < Long.MAX_VALUE) {
-                    next = next/2;
-                    next = (next < MIN_MILLIS) ? MIN_MILLIS : next;
-                } else {
-                    close();
-                }
-            }
-
-            nextRenewTime = System.currentTimeMillis() + next;
-
-            if (logger.traceOn()) {
-                logger.trace("myRenew-run", "Next leasing: "+next);
-            }
-
-            synchronized(lock) {
-                if (!closed) {
-                    future = scheduler.schedule(this, next, TimeUnit.MILLISECONDS);
-                }
-            }
-        }
-    };
-
-    private final Callable<Long> doRenew;
-    private ScheduledFuture<?> future;
-    private boolean closed = false;
-    private long nextRenewTime;
-
-    private final int[] lock = new int[0];
-
-    private final ScheduledExecutorService scheduler;
-
-    private static final long MIN_MILLIS = 50;
-
-    private static final ClassLogger logger =
-            new ClassLogger("javax.management.event", "LeaseRenewer");
-}
--- a/src/share/classes/com/sun/jmx/event/ReceiverBuffer.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-/*
- * Copyright 2007-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 com.sun.jmx.event;
-
-import com.sun.jmx.remote.util.ClassLogger;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import javax.management.remote.NotificationResult;
-import javax.management.remote.TargetedNotification;
-
-
-public class ReceiverBuffer {
-    public void addNotifs(NotificationResult nr) {
-        if (nr == null) {
-            return;
-        }
-
-        TargetedNotification[] tns = nr.getTargetedNotifications();
-
-        if (logger.traceOn()) {
-            logger.trace("addNotifs", "" + tns.length);
-        }
-
-        long impliedStart = nr.getEarliestSequenceNumber();
-        final long missed = impliedStart - start;
-        start = nr.getNextSequenceNumber();
-
-        if (missed > 0) {
-            if (logger.traceOn()) {
-                logger.trace("addNotifs",
-                        "lost: "+missed);
-            }
-
-            lost += missed;
-        }
-
-        Collections.addAll(notifList, nr.getTargetedNotifications());
-    }
-
-    public TargetedNotification[] removeNotifs() {
-        if (logger.traceOn()) {
-            logger.trace("removeNotifs", String.valueOf(notifList.size()));
-        }
-
-        if (notifList.size() == 0) {
-            return null;
-        }
-
-        TargetedNotification[] ret = notifList.toArray(
-                new TargetedNotification[]{});
-        notifList.clear();
-
-        return ret;
-    }
-
-    public int size() {
-        return notifList.size();
-    }
-
-    public int removeLost() {
-        int ret = lost;
-        lost = 0;
-        return ret;
-    }
-
-    private List<TargetedNotification> notifList
-            = new ArrayList<TargetedNotification>();
-    private long start = 0;
-    private int lost = 0;
-
-    private static final ClassLogger logger =
-            new ClassLogger("javax.management.event", "ReceiverBuffer");
-}
--- a/src/share/classes/com/sun/jmx/event/RepeatedSingletonJob.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright 2007-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 com.sun.jmx.event;
-
-import com.sun.jmx.remote.util.ClassLogger;
-import java.util.concurrent.Executor;
-import java.util.concurrent.RejectedExecutionException;
-
-/**
- * <p>A task that is repeatedly run by an Executor.  The task will be
- * repeated as long as the {@link #isSuspended()} method returns true.  Once
- * that method returns false, the task is no longer executed until someone
- * calls {@link #resume()}.</p>
- * @author sjiang
- */
-public abstract class RepeatedSingletonJob implements Runnable {
-    public RepeatedSingletonJob(Executor executor) {
-        if (executor == null) {
-            throw new NullPointerException("Null executor!");
-        }
-
-        this.executor = executor;
-    }
-
-    public boolean isWorking() {
-        return working;
-    }
-
-    public void resume() {
-
-        synchronized(this) {
-            if (!working)  {
-                if (logger.traceOn()) {
-                    logger.trace("resume", "");
-                }
-                working = true;
-                execute();
-            }
-        }
-    }
-
-    public abstract void task();
-    public abstract boolean isSuspended();
-
-    public void run() {
-        if (logger.traceOn()) {
-            logger.trace("run", "execute the task");
-        }
-        try {
-            task();
-        } catch (Exception e) {
-            // A correct task() implementation should not throw exceptions.
-            // It may cause isSuspended() to start returning true, though.
-            logger.trace("run", "failed to execute the task", e);
-        }
-
-        synchronized(this) {
-            if (!isSuspended()) {
-                execute();
-            } else {
-                if (logger.traceOn()) {
-                    logger.trace("run", "suspend the task");
-                }
-                working = false;
-            }
-        }
-
-    }
-
-    private void execute() {
-        try {
-            executor.execute(this);
-        } catch (RejectedExecutionException e) {
-            logger.warning(
-                    "execute",
-                    "Executor threw exception (" + this.getClass().getName() + ")",
-                    e);
-            throw new RejectedExecutionException(
-                    "Executor.execute threw exception -" +
-                    "should not be possible", e);
-            // User-supplied Executor should not be configured in a way that
-            // might cause this exception, for example if it is shared between
-            // several client objects and doesn't have capacity for one job
-            // from each one.  CR 6732037 will add text to the spec explaining
-            // the problem.  The rethrown exception will propagate either out
-            // of resume() to user code, or out of run() to the Executor
-            // (which will probably ignore it).
-        }
-    }
-
-    private boolean working = false;
-    private final Executor executor;
-
-    private static final ClassLogger logger =
-            new ClassLogger("javax.management.event", "RepeatedSingletonJob");
-}
--- a/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java	Wed Nov 25 22:14:30 2009 -0800
@@ -30,16 +30,15 @@
 import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER;
 import com.sun.jmx.mbeanserver.DynamicMBean2;
 import com.sun.jmx.mbeanserver.Introspector;
-import com.sun.jmx.mbeanserver.MBeanInjector;
 import com.sun.jmx.mbeanserver.MBeanInstantiator;
 import com.sun.jmx.mbeanserver.ModifiableClassLoaderRepository;
 import com.sun.jmx.mbeanserver.NamedObject;
-import com.sun.jmx.mbeanserver.NotifySupport;
 import com.sun.jmx.mbeanserver.Repository;
 import com.sun.jmx.mbeanserver.Repository.RegistrationContext;
 import com.sun.jmx.mbeanserver.Util;
 import com.sun.jmx.remote.util.EnvHelp;
 
+import java.io.ObjectInputStream;
 import java.lang.ref.WeakReference;
 import java.security.AccessControlContext;
 import java.security.AccessController;
@@ -48,10 +47,7 @@
 import java.security.ProtectionDomain;
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
-import java.util.Queue;
 import java.util.Set;
 import java.util.WeakHashMap;
 import java.util.logging.Level;
@@ -61,7 +57,6 @@
 import javax.management.AttributeList;
 import javax.management.AttributeNotFoundException;
 import javax.management.DynamicMBean;
-import javax.management.DynamicWrapperMBean;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.IntrospectionException;
@@ -70,7 +65,6 @@
 import javax.management.ListenerNotFoundException;
 import javax.management.MBeanException;
 import javax.management.MBeanInfo;
-import javax.management.MBeanNotificationInfo;
 import javax.management.MBeanPermission;
 import javax.management.MBeanRegistration;
 import javax.management.MBeanRegistrationException;
@@ -81,19 +75,19 @@
 import javax.management.NotCompliantMBeanException;
 import javax.management.Notification;
 import javax.management.NotificationBroadcaster;
-import javax.management.NotificationBroadcasterSupport;
 import javax.management.NotificationEmitter;
 import javax.management.NotificationFilter;
 import javax.management.NotificationListener;
 import javax.management.ObjectInstance;
 import javax.management.ObjectName;
+import javax.management.OperationsException;
 import javax.management.QueryEval;
 import javax.management.QueryExp;
 import javax.management.ReflectionException;
 import javax.management.RuntimeErrorException;
 import javax.management.RuntimeMBeanException;
 import javax.management.RuntimeOperationsException;
-import javax.management.namespace.JMXNamespace;
+import javax.management.loading.ClassLoaderRepository;
 
 /**
  * This is the default class for MBean manipulation on the agent side. It
@@ -116,8 +110,7 @@
  *
  * @since 1.5
  */
-public class DefaultMBeanServerInterceptor
-        extends MBeanServerInterceptorSupport {
+public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
 
     /** The MBeanInstantiator object used by the
      *  DefaultMBeanServerInterceptor */
@@ -142,14 +135,9 @@
                 new WeakHashMap<ListenerWrapper,
                                 WeakReference<ListenerWrapper>>();
 
-    private final NamespaceDispatchInterceptor dispatcher;
-
     /** The default domain of the object names */
     private final String domain;
 
-    /** The mbeanServerName  */
-    private final String mbeanServerName;
-
     /** The sequence number identifying the notifications sent */
     // Now sequence number is handled by MBeanServerDelegate.
     // private int sequenceNumber=0;
@@ -168,13 +156,11 @@
      * @param instantiator The MBeanInstantiator that will be used to
      *        instantiate MBeans and take care of class loading issues.
      * @param repository The repository to use for this MBeanServer.
-     * @param dispatcher The dispatcher used by this MBeanServer
      */
     public DefaultMBeanServerInterceptor(MBeanServer         outer,
                                          MBeanServerDelegate delegate,
                                          MBeanInstantiator   instantiator,
-                                         Repository          repository,
-                                         NamespaceDispatchInterceptor dispatcher)  {
+                                         Repository          repository) {
         if (outer == null) throw new
             IllegalArgumentException("outer MBeanServer cannot be null");
         if (delegate == null) throw new
@@ -189,8 +175,6 @@
         this.instantiator = instantiator;
         this.repository   = repository;
         this.domain       = repository.getDefaultDomain();
-        this.dispatcher   = dispatcher;
-        this.mbeanServerName = Util.getMBeanServerSecurityName(delegate);
     }
 
     public ObjectInstance createMBean(String className, ObjectName name)
@@ -269,8 +253,8 @@
             name = nonDefaultDomain(name);
         }
 
-        checkMBeanPermission(mbeanServerName,className, null, null, "instantiate");
-        checkMBeanPermission(mbeanServerName,className, null, name, "registerMBean");
+        checkMBeanPermission(className, null, null, "instantiate");
+        checkMBeanPermission(className, null, name, "registerMBean");
 
         /* Load the appropriate class. */
         if (withDefaultLoaderRepository) {
@@ -334,7 +318,7 @@
 
         final String infoClassName = getNewMBeanClassName(object);
 
-        checkMBeanPermission(mbeanServerName,infoClassName, null, name, "registerMBean");
+        checkMBeanPermission(infoClassName, null, name, "registerMBean");
         checkMBeanTrustPermission(theClass);
 
         return registerObject(infoClassName, object, name);
@@ -443,8 +427,7 @@
         DynamicMBean instance = getMBean(name);
         // may throw InstanceNotFoundException
 
-        checkMBeanPermission(mbeanServerName, instance, null, name,
-                "unregisterMBean");
+        checkMBeanPermission(instance, null, name, "unregisterMBean");
 
         if (instance instanceof MBeanRegistration)
             preDeregisterInvoke((MBeanRegistration) instance);
@@ -478,8 +461,7 @@
         name = nonDefaultDomain(name);
         DynamicMBean instance = getMBean(name);
 
-        checkMBeanPermission(mbeanServerName,
-                instance, null, name, "getObjectInstance");
+        checkMBeanPermission(instance, null, name, "getObjectInstance");
 
         final String className = getClassName(instance);
 
@@ -491,7 +473,7 @@
         if (sm != null) {
             // Check if the caller has the right to invoke 'queryMBeans'
             //
-            checkMBeanPermission(mbeanServerName,(String) null, null, null, "queryMBeans");
+            checkMBeanPermission((String) null, null, null, "queryMBeans");
 
             // Perform query without "query".
             //
@@ -504,7 +486,7 @@
                 new HashSet<ObjectInstance>(list.size());
             for (ObjectInstance oi : list) {
                 try {
-                    checkMBeanPermission(mbeanServerName,oi.getClassName(), null,
+                    checkMBeanPermission(oi.getClassName(), null,
                                          oi.getObjectName(), "queryMBeans");
                     allowedList.add(oi);
                 } catch (SecurityException e) {
@@ -537,7 +519,7 @@
         if (sm != null) {
             // Check if the caller has the right to invoke 'queryNames'
             //
-            checkMBeanPermission(mbeanServerName,(String) null, null, null, "queryNames");
+            checkMBeanPermission((String) null, null, null, "queryNames");
 
             // Perform query without "query".
             //
@@ -550,7 +532,7 @@
                 new HashSet<ObjectInstance>(list.size());
             for (ObjectInstance oi : list) {
                 try {
-                    checkMBeanPermission(mbeanServerName, oi.getClassName(), null,
+                    checkMBeanPermission(oi.getClassName(), null,
                                          oi.getObjectName(), "queryNames");
                     allowedList.add(oi);
                 } catch (SecurityException e) {
@@ -602,7 +584,7 @@
         if (sm != null) {
             // Check if the caller has the right to invoke 'getDomains'
             //
-            checkMBeanPermission(mbeanServerName, (String) null, null, null, "getDomains");
+            checkMBeanPermission((String) null, null, null, "getDomains");
 
             // Return domains
             //
@@ -614,8 +596,8 @@
             List<String> result = new ArrayList<String>(domains.length);
             for (int i = 0; i < domains.length; i++) {
                 try {
-                    ObjectName dom = ObjectName.valueOf(domains[i] + ":x=x");
-                    checkMBeanPermission(mbeanServerName, (String) null, null, dom, "getDomains");
+                    ObjectName dom = Util.newObjectName(domains[i] + ":x=x");
+                    checkMBeanPermission((String) null, null, dom, "getDomains");
                     result.add(domains[i]);
                 } catch (SecurityException e) {
                     // OK: Do not add this domain to the list
@@ -659,8 +641,7 @@
         }
 
         final DynamicMBean instance = getMBean(name);
-        checkMBeanPermission(mbeanServerName, instance, attribute,
-                name, "getAttribute");
+        checkMBeanPermission(instance, attribute, name, "getAttribute");
 
         try {
             return instance.getAttribute(attribute);
@@ -705,7 +686,7 @@
 
             // Check if the caller has the right to invoke 'getAttribute'
             //
-            checkMBeanPermission(mbeanServerName, classname, null, name, "getAttribute");
+            checkMBeanPermission(classname, null, name, "getAttribute");
 
             // Check if the caller has the right to invoke 'getAttribute'
             // on each specific attribute
@@ -714,8 +695,7 @@
                 new ArrayList<String>(attributes.length);
             for (String attr : attributes) {
                 try {
-                    checkMBeanPermission(mbeanServerName, classname, attr,
-                                         name, "getAttribute");
+                    checkMBeanPermission(classname, attr, name, "getAttribute");
                     allowedList.add(attr);
                 } catch (SecurityException e) {
                     // OK: Do not add this attribute to the list
@@ -760,8 +740,7 @@
         }
 
         DynamicMBean instance = getMBean(name);
-        checkMBeanPermission(mbeanServerName, instance, attribute.getName(),
-                             name, "setAttribute");
+        checkMBeanPermission(instance, attribute.getName(), name, "setAttribute");
 
         try {
             instance.setAttribute(attribute);
@@ -803,7 +782,7 @@
 
             // Check if the caller has the right to invoke 'setAttribute'
             //
-            checkMBeanPermission(mbeanServerName, classname, null, name, "setAttribute");
+            checkMBeanPermission(classname, null, name, "setAttribute");
 
             // Check if the caller has the right to invoke 'setAttribute'
             // on each specific attribute
@@ -811,7 +790,7 @@
             allowedAttributes = new AttributeList(attributes.size());
             for (Attribute attribute : attributes.asList()) {
                 try {
-                    checkMBeanPermission(mbeanServerName, classname, attribute.getName(),
+                    checkMBeanPermission(classname, attribute.getName(),
                                          name, "setAttribute");
                     allowedAttributes.add(attribute);
                 } catch (SecurityException e) {
@@ -835,8 +814,7 @@
         name = nonDefaultDomain(name);
 
         DynamicMBean instance = getMBean(name);
-        checkMBeanPermission(mbeanServerName, instance, operationName,
-                name, "invoke");
+        checkMBeanPermission(instance, operationName, name, "invoke");
         try {
             return instance.invoke(operationName, params, signature);
         } catch (Throwable t) {
@@ -919,12 +897,6 @@
 
         DynamicMBean mbean = Introspector.makeDynamicMBean(object);
 
-        //Access the ObjectName template value only if the provided name is null
-        if(name == null) {
-            name = Introspector.templateToObjectName(mbean.getMBeanInfo().
-                    getDescriptor(), mbean);
-        }
-
         return registerDynamicMBean(classname, mbean, name);
     }
 
@@ -953,8 +925,6 @@
         ResourceContext context = null;
 
         try {
-            mbean = injectResources(mbean, server, logicalName);
-
             if (mbean instanceof DynamicMBean2) {
                 try {
                     ((DynamicMBean2) mbean).preRegister2(server, logicalName);
@@ -973,8 +943,7 @@
                         ObjectName.getInstance(nonDefaultDomain(logicalName));
             }
 
-            checkMBeanPermission(mbeanServerName, classname, null, logicalName,
-                    "registerMBean");
+            checkMBeanPermission(classname, null, logicalName, "registerMBean");
 
             if (logicalName == null) {
                 final RuntimeException wrapped =
@@ -988,10 +957,9 @@
             // Register the MBean with the repository.
             // Returns the resource context that was used.
             // The returned context does nothing for regular MBeans.
-            // For ClassLoader MBeans and JMXNamespace (and JMXDomain)
-            // MBeans - the context makes it possible to register these
+            // For ClassLoader MBeans the context makes it possible to register these
             // objects with the appropriate framework artifacts, such as
-            // the CLR or the dispatcher, from within the repository lock.
+            // the CLR, from within the repository lock.
             // In case of success, we also need to call context.done() at the
             // end of this method.
             //
@@ -1045,27 +1013,6 @@
         else return name;
     }
 
-    private static DynamicMBean injectResources(
-            DynamicMBean mbean, MBeanServer mbs, ObjectName name)
-    throws MBeanRegistrationException {
-        try {
-            Object resource = getResource(mbean);
-            MBeanInjector.inject(resource, mbs, name);
-            if (MBeanInjector.injectsSendNotification(resource)) {
-                MBeanNotificationInfo[] mbnis =
-                        mbean.getMBeanInfo().getNotifications();
-                NotificationBroadcasterSupport nbs =
-                        new NotificationBroadcasterSupport(mbnis);
-                MBeanInjector.injectSendNotification(resource, nbs);
-                mbean = NotifySupport.wrap(mbean, nbs);
-            }
-            return mbean;
-        } catch (Throwable t) {
-            throwMBeanRegistrationException(t, "injecting @Resources");
-            return null;  // not reached
-        }
-    }
-
     private static void postRegister(
             ObjectName logicalName, DynamicMBean mbean,
             boolean registrationDone, boolean registerFailed) {
@@ -1151,19 +1098,12 @@
     }
 
     private static Object getResource(DynamicMBean mbean) {
-        if (mbean instanceof DynamicWrapperMBean)
-            return ((DynamicWrapperMBean) mbean).getWrappedObject();
+        if (mbean instanceof DynamicMBean2)
+            return ((DynamicMBean2) mbean).getResource();
         else
             return mbean;
     }
 
-    private static ClassLoader getResourceLoader(DynamicMBean mbean) {
-        if (mbean instanceof DynamicWrapperMBean)
-            return ((DynamicWrapperMBean) mbean).getWrappedClassLoader();
-        else
-            return mbean.getClass().getClassLoader();
-    }
-
     private ObjectName nonDefaultDomain(ObjectName name) {
         if (name == null || name.getDomain().length() > 0)
             return name;
@@ -1177,7 +1117,7 @@
            if one is supplied where it shouldn't be).  */
         final String completeName = domain + name;
 
-        return ObjectName.valueOf(completeName);
+        return Util.newObjectName(completeName);
     }
 
     public String getDefaultDomain()  {
@@ -1243,8 +1183,7 @@
         }
 
         DynamicMBean instance = getMBean(name);
-        checkMBeanPermission(mbeanServerName, instance, null,
-                name, "addNotificationListener");
+        checkMBeanPermission(instance, null, name, "addNotificationListener");
 
         NotificationBroadcaster broadcaster =
                 getNotificationBroadcaster(name, instance,
@@ -1381,8 +1320,7 @@
         }
 
         DynamicMBean instance = getMBean(name);
-        checkMBeanPermission(mbeanServerName, instance, null, name,
-                             "removeNotificationListener");
+        checkMBeanPermission(instance, null, name, "removeNotificationListener");
 
         /* We could simplify the code by assigning broadcaster after
            assigning listenerWrapper, but that would change the error
@@ -1415,8 +1353,8 @@
                                          Class<T> reqClass) {
         if (reqClass.isInstance(instance))
             return reqClass.cast(instance);
-        if (instance instanceof DynamicWrapperMBean)
-            instance = ((DynamicWrapperMBean) instance).getWrappedObject();
+        if (instance instanceof DynamicMBean2)
+            instance = ((DynamicMBean2) instance).getResource();
         if (reqClass.isInstance(instance))
             return reqClass.cast(instance);
         final RuntimeException exc =
@@ -1452,7 +1390,7 @@
             throw new JMRuntimeException("MBean " + name +
                                          "has no MBeanInfo");
 
-        checkMBeanPermission(mbeanServerName, mbi.getClassName(), null, name, "getMBeanInfo");
+        checkMBeanPermission(mbi.getClassName(), null, name, "getMBeanInfo");
 
         return mbi;
     }
@@ -1461,8 +1399,7 @@
         throws InstanceNotFoundException {
 
         final DynamicMBean instance = getMBean(name);
-        checkMBeanPermission(mbeanServerName,
-                instance, null, name, "isInstanceOf");
+        checkMBeanPermission(instance, null, name, "isInstanceOf");
 
         try {
             Object resource = getResource(instance);
@@ -1474,20 +1411,12 @@
 
             if (resourceClassName.equals(className))
                 return true;
-            final ClassLoader cl = getResourceLoader(instance);
+            final ClassLoader cl = resource.getClass().getClassLoader();
 
             final Class<?> classNameClass = Class.forName(className, false, cl);
             if (classNameClass.isInstance(resource))
                 return true;
 
-            // Ensure that isInstanceOf(NotificationEmitter) is true when
-            // the MBean is a NotificationEmitter by virtue of a @Resource
-            // annotation specifying a SendNotification resource.
-            // This is a hack.
-            if (instance instanceof NotificationBroadcaster &&
-                    classNameClass.isAssignableFrom(NotificationEmitter.class))
-                return true;
-
             final Class<?> resourceClass = Class.forName(resourceClassName, false, cl);
             return classNameClass.isAssignableFrom(resourceClass);
         } catch (Exception x) {
@@ -1513,9 +1442,8 @@
         throws InstanceNotFoundException {
 
         DynamicMBean instance = getMBean(mbeanName);
-        checkMBeanPermission(mbeanServerName, instance, null, mbeanName,
-                "getClassLoaderFor");
-        return getResourceLoader(instance);
+        checkMBeanPermission(instance, null, mbeanName, "getClassLoaderFor");
+        return getResource(instance).getClass().getClassLoader();
     }
 
     /**
@@ -1529,13 +1457,12 @@
             throws InstanceNotFoundException {
 
         if (loaderName == null) {
-            checkMBeanPermission(mbeanServerName, (String) null, null, null, "getClassLoader");
+            checkMBeanPermission((String) null, null, null, "getClassLoader");
             return server.getClass().getClassLoader();
         }
 
         DynamicMBean instance = getMBean(loaderName);
-        checkMBeanPermission(mbeanServerName, instance, null, loaderName,
-                "getClassLoader");
+        checkMBeanPermission(instance, null, loaderName, "getClassLoader");
 
         Object resource = getResource(instance);
 
@@ -1757,6 +1684,49 @@
         }
     }
 
+    public Object instantiate(String className) throws ReflectionException,
+                                                       MBeanException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public Object instantiate(String className, ObjectName loaderName) throws ReflectionException,
+                                                                              MBeanException,
+                                                                              InstanceNotFoundException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public Object instantiate(String className, Object[] params,
+            String[] signature) throws ReflectionException, MBeanException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public Object instantiate(String className, ObjectName loaderName,
+            Object[] params, String[] signature) throws ReflectionException,
+                                                        MBeanException,
+                                                        InstanceNotFoundException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public ObjectInputStream deserialize(ObjectName name, byte[] data) throws InstanceNotFoundException,
+                                                                              OperationsException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public ObjectInputStream deserialize(String className, byte[] data) throws OperationsException,
+                                                                               ReflectionException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public ObjectInputStream deserialize(String className, ObjectName loaderName,
+            byte[] data) throws InstanceNotFoundException, OperationsException,
+                                ReflectionException {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
+    public ClassLoaderRepository getClassLoaderRepository() {
+        throw new UnsupportedOperationException("Not supported yet.");
+    }
+
     private static class ListenerWrapper implements NotificationListener {
         ListenerWrapper(NotificationListener l, ObjectName name,
                         Object mbean) {
@@ -1834,30 +1804,26 @@
             return mbean.getMBeanInfo().getClassName();
     }
 
-    private static void checkMBeanPermission(String mbeanServerName,
-                                             DynamicMBean mbean,
+    private static void checkMBeanPermission(DynamicMBean mbean,
                                              String member,
                                              ObjectName objectName,
                                              String actions) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            checkMBeanPermission(mbeanServerName,
-                                 safeGetClassName(mbean),
+            checkMBeanPermission(safeGetClassName(mbean),
                                  member,
                                  objectName,
                                  actions);
         }
     }
 
-    private static void checkMBeanPermission(String mbeanServerName,
-                                             String classname,
+    private static void checkMBeanPermission(String classname,
                                              String member,
                                              ObjectName objectName,
                                              String actions) {
         SecurityManager sm = System.getSecurityManager();
         if (sm != null) {
-            Permission perm = new MBeanPermission(mbeanServerName,
-                                                  classname,
+            Permission perm = new MBeanPermission(classname,
                                                   member,
                                                   objectName,
                                                   actions);
@@ -1923,12 +1889,6 @@
             throws InstanceAlreadyExistsException,
             MBeanRegistrationException {
 
-        // this will throw an exception if the pair (resource, logicalName)
-        // violates namespace conventions - for instance, if logicalName
-        // ends with // but resource is not a JMXNamespace.
-        //
-        checkResourceObjectNameConstraints(resource, logicalName);
-
         // Creates a registration context, if needed.
         //
         final ResourceContext context =
@@ -1996,56 +1956,6 @@
 
 
     /**
-     * Checks that the ObjectName is legal with regards to the
-     * type of the MBean resource.
-     * If the MBean name is  domain:type=JMXDomain, the
-     *     MBean must be a JMXDomain.
-     * If the MBean name is  namespace//:type=JMXNamespace, the
-     *     MBean must be a JMXNamespace.
-     * If the MBean is a JMXDomain, its name
-     *      must be domain:type=JMXDomain.
-     * If the MBean is a JMXNamespace,  its name
-     *      must be namespace//:type=JMXNamespace.
-     */
-    private void checkResourceObjectNameConstraints(Object resource,
-            ObjectName logicalName)
-            throws MBeanRegistrationException {
-        try {
-            dispatcher.checkLocallyRegistrable(resource, logicalName);
-        } catch (Throwable x) {
-            DefaultMBeanServerInterceptor.throwMBeanRegistrationException(x, "validating ObjectName");
-        }
-    }
-
-    /**
-     * Registers a JMXNamespace with the dispatcher.
-     * This method is called by the ResourceContext from within the
-     * repository lock.
-     * @param namespace    The JMXNamespace
-     * @param logicalName  The JMXNamespaceMBean ObjectName
-     * @param postQueue    A queue that will be processed after postRegister.
-     */
-    private void addJMXNamespace(JMXNamespace namespace,
-            final ObjectName logicalName,
-            final Queue<Runnable> postQueue) {
-        dispatcher.addInterceptorFor(logicalName, namespace, postQueue);
-    }
-
-    /**
-     * Unregisters a JMXNamespace from the dispatcher.
-     * This method is called by the ResourceContext from within the
-     * repository lock.
-     * @param namespace    The JMXNamespace
-     * @param logicalName  The JMXNamespaceMBean ObjectName
-     * @param postQueue    A queue that will be processed after postDeregister.
-     */
-    private void removeJMXNamespace(JMXNamespace namespace,
-            final ObjectName logicalName,
-            final Queue<Runnable> postQueue) {
-        dispatcher.removeInterceptorFor(logicalName, namespace, postQueue);
-    }
-
-    /**
      * Registers a ClassLoader with the CLR.
      * This method is called by the ResourceContext from within the
      * repository lock.
@@ -2100,51 +2010,6 @@
 
 
     /**
-     * Creates a ResourceContext for a JMXNamespace MBean.
-     * The resource context makes it possible to add the JMXNamespace to
-     * (ResourceContext.registering) or resp. remove the JMXNamespace from
-     * (ResourceContext.unregistered) the NamespaceDispatchInterceptor
-     * when the associated MBean is added to or resp. removed from the
-     * repository.
-     * Note: JMXDomains are special sub classes of JMXNamespaces and
-     *       are also handled by this object.
-     *
-     * @param namespace    The JMXNamespace MBean being registered or
-     *                     unregistered.
-     * @param logicalName  The name of the JMXNamespace MBean.
-     * @return a ResourceContext that takes in charge the addition or removal
-     *         of the namespace to or from the NamespaceDispatchInterceptor.
-     */
-    private ResourceContext createJMXNamespaceContext(
-            final JMXNamespace namespace,
-            final ObjectName logicalName) {
-        final Queue<Runnable> doneTaskQueue = new LinkedList<Runnable>();
-        return new ResourceContext() {
-
-            public void registering() {
-                addJMXNamespace(namespace, logicalName, doneTaskQueue);
-            }
-
-            public void unregistered() {
-                removeJMXNamespace(namespace, logicalName,
-                                   doneTaskQueue);
-            }
-
-            public void done() {
-                for (Runnable r : doneTaskQueue) {
-                    try {
-                        r.run();
-                    } catch (RuntimeException x) {
-                        MBEANSERVER_LOGGER.log(Level.FINE,
-                                "Failed to process post queue for "+
-                                logicalName, x);
-                    }
-                }
-            }
-        };
-    }
-
-    /**
      * Creates a ResourceContext for a ClassLoader MBean.
      * The resource context makes it possible to add the ClassLoader to
      * (ResourceContext.registering) or resp. remove the ClassLoader from
@@ -2180,8 +2045,7 @@
      * Creates a ResourceContext for the given resource.
      * If the resource does not need a ResourceContext, returns
      * ResourceContext.NONE.
-     * At this time, only JMXNamespaces and ClassLoaders need a
-     * ResourceContext.
+     * At this time, only ClassLoaders need a ResourceContext.
      *
      * @param resource     The resource being registered or unregistered.
      * @param logicalName  The name of the associated MBean.
@@ -2189,10 +2053,6 @@
      */
     private ResourceContext makeResourceContextFor(Object resource,
             ObjectName logicalName) {
-        if (resource instanceof JMXNamespace) {
-            return createJMXNamespaceContext((JMXNamespace) resource,
-                    logicalName);
-        }
         if (resource instanceof ClassLoader) {
             return createClassLoaderContext((ClassLoader) resource,
                     logicalName);
--- a/src/share/classes/com/sun/jmx/interceptor/DispatchInterceptor.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,551 +0,0 @@
-/*
- * 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 com.sun.jmx.interceptor;
-
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Queue;
-import java.util.Set;
-
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.AttributeNotFoundException;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InstanceNotFoundException;
-import javax.management.IntrospectionException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanRegistrationException;
-import javax.management.MBeanServer;
-import javax.management.NotCompliantMBeanException;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-import javax.management.QueryExp;
-import javax.management.ReflectionException;
-import javax.management.namespace.JMXNamespace;
-
-/**
- * A dispatcher that dispatches to MBeanServers.
- * <p><b>
- * This API is a Sun internal API and is subject to changes without notice.
- * </b></p>
- * @since 1.7
- */
-//
-// This is the base class for implementing dispatchers. We have two concrete
-// dispatcher implementations:
-//
-//   * A NamespaceDispatchInterceptor, which dispatch calls to existing
-//     namespace interceptors
-//   * A DomainDispatchInterceptor, which dispatch calls to existing domain
-//     interceptors.
-//
-// With the JMX Namespaces feature, the JMX MBeanServer is now structured
-// as follows:
-//
-// The JMX MBeanServer delegates to a NamespaceDispatchInterceptor,
-// which either dispatches to a namespace, or delegates to the
-// DomainDispatchInterceptor (if the object name contained no namespace).
-// The DomainDispatchInterceptor in turn either dispatches to a domain (if
-// there is a JMXDomain for that domain) or delegates to the
-// DefaultMBeanServerInterceptor (if there is no JMXDomain for that
-// domain). This makes the following picture:
-//
-//             JMX MBeanServer (outer shell)
-//                          |
-//                          |
-//              NamespaceDispatchInterceptor
-//                   /               \
-//     no namespace in object name?   \
-//                 /                   \
-//                /                   dispatch to namespace
-//         DomainDispatchInterceptor
-//              /              \
-//    no JMXDomain for domain?  \
-//            /                  \
-//           /                   dispatch to domain
-//  DefaultMBeanServerInterceptor
-//         /
-//   invoke locally registered MBean
-//
-//  The logic for maintaining a map of interceptors
-//  and dispatching to impacted interceptor, is implemented in this
-//  base class, which both NamespaceDispatchInterceptor and
-//  DomainDispatchInterceptor extend.
-//
-public abstract class DispatchInterceptor
-        <T extends MBeanServer, N extends JMXNamespace>
-        extends MBeanServerInterceptorSupport {
-
-    /**
-     * This is an abstraction which allows us to handle queryNames
-     * and queryMBeans with the same algorithm. There are some subclasses
-     * where we need to override both queryNames & queryMBeans to apply
-     * the same transformation (usually aggregation of results when
-     * several namespaces/domains are impacted) to both algorithms.
-     * Usually the only thing that varies between the algorithm of
-     * queryNames & the algorithm of queryMBean is the type of objects
-     * in the returned Set. By using a QueryInvoker we can implement the
-     * transformation only once and apply it to both queryNames &
-     * queryMBeans.
-     * @see QueryInterceptor below, and its subclass in
-     * {@link DomainDispatcher}.
-     **/
-    static abstract class QueryInvoker<T> {
-        abstract Set<T> query(MBeanServer mbs,
-                        ObjectName pattern, QueryExp query);
-    }
-
-    /**
-     * Used to perform queryNames. A QueryInvoker that invokes
-     * queryNames on an MBeanServer.
-     **/
-    final static QueryInvoker<ObjectName> queryNamesInvoker =
-            new QueryInvoker<ObjectName>() {
-        Set<ObjectName> query(MBeanServer mbs,
-                        ObjectName pattern, QueryExp query) {
-            return mbs.queryNames(pattern,query);
-        }
-    };
-
-    /**
-     * Used to perform queryMBeans. A QueryInvoker that invokes
-     * queryMBeans on an MBeanServer.
-     **/
-    final static QueryInvoker<ObjectInstance> queryMBeansInvoker =
-            new QueryInvoker<ObjectInstance>() {
-        Set<ObjectInstance> query(MBeanServer mbs,
-                        ObjectName pattern, QueryExp query) {
-            return mbs.queryMBeans(pattern,query);
-        }
-    };
-
-    /**
-     * We use this class to intercept queries.
-     * There's a special case for JMXNamespace MBeans, because
-     * "namespace//*:*" matches both "namespace//domain:k=v" and
-     * "namespace//:type=JMXNamespace".
-     * Therefore, queries may need to be forwarded to more than
-     * on interceptor and the results aggregated...
-     */
-     static class QueryInterceptor {
-        final MBeanServer wrapped;
-        QueryInterceptor(MBeanServer mbs) {
-            wrapped = mbs;
-        }
-        <X> Set<X> query(ObjectName pattern, QueryExp query,
-                QueryInvoker<X> invoker, MBeanServer server) {
-            return invoker.query(server, pattern, query);
-        }
-
-        public Set<ObjectName> queryNames(ObjectName pattern, QueryExp query) {
-            return query(pattern,query,queryNamesInvoker,wrapped);
-        }
-
-        public Set<ObjectInstance> queryMBeans(ObjectName pattern,
-                QueryExp query) {
-            return query(pattern,query,queryMBeansInvoker,wrapped);
-        }
-    }
-
-    // We don't need a ConcurrentHashMap here because getkeys() returns
-    // an array of keys. Therefore there's no risk to have a
-    // ConcurrentModificationException. We must however take into
-    // account the fact that there can be no interceptor for
-    // some of the returned keys if the map is being modified by
-    // another thread, or by a callback within the same thread...
-    // See getKeys() in this class and query() in DomainDispatcher.
-    //
-    private final Map<String,T> handlerMap =
-            Collections.synchronizedMap(
-            new HashMap<String,T>());
-
-    // The key at which an interceptor for accessing the named MBean can be
-    // found in the handlerMap. Note: there doesn't need to be an interceptor
-    // for that key in the Map.
-    //
-    abstract String getHandlerKey(ObjectName name);
-
-    // Returns an interceptor for that name, or null if there's no interceptor
-    // for that name.
-    abstract MBeanServer getInterceptorOrNullFor(ObjectName name);
-
-    // Returns a QueryInterceptor for that pattern.
-    abstract QueryInterceptor getInterceptorForQuery(ObjectName pattern);
-
-    // Returns the ObjectName of the JMXNamespace (or JMXDomain) for that
-    // key (a namespace or a domain name).
-    abstract ObjectName getHandlerNameFor(String key);
-
-    // Creates an interceptor for the given key, name, JMXNamespace (or
-    // JMXDomain). Note: this will be either a NamespaceInterceptor
-    // wrapping a JMXNamespace, if this object is an instance of
-    // NamespaceDispatchInterceptor, or a DomainInterceptor wrapping a
-    // JMXDomain, if this object is an instance of DomainDispatchInterceptor.
-    abstract T createInterceptorFor(String key, ObjectName name,
-            N jmxNamespace, Queue<Runnable> postRegisterQueue);
-    //
-    // The next interceptor in the chain.
-    //
-    // For the NamespaceDispatchInterceptor, this the DomainDispatchInterceptor.
-    // For the DomainDispatchInterceptor, this is the
-    // DefaultMBeanServerInterceptor.
-    //
-    // The logic of when to invoke the next interceptor in the chain depends
-    // on the logic of the concrete dispatcher class.
-    //
-    // For instance, the NamespaceDispatchInterceptor invokes the next
-    // interceptor when the object name doesn't contain any namespace.
-    //
-    // On the other hand, the DomainDispatchInterceptor invokes the
-    // next interceptor when there's no interceptor for the accessed domain.
-    //
-    abstract MBeanServer getNextInterceptor();
-
-    // hook for cleanup in subclasses.
-    void interceptorReleased(T interceptor,
-            Queue<Runnable> postDeregisterQueue) {
-        // hook
-    }
-
-    // Hook for subclasses.
-    MBeanServer getInterceptorForCreate(ObjectName name)
-        throws MBeanRegistrationException {
-        final MBeanServer ns = getInterceptorOrNullFor(name);
-        if (ns == null) // name cannot be null here.
-            throw new MBeanRegistrationException(
-                    new IllegalArgumentException("No such MBean handler: " +
-                        getHandlerKey(name) + " for " +name));
-        return ns;
-    }
-
-    // Hook for subclasses.
-    MBeanServer getInterceptorForInstance(ObjectName name)
-        throws InstanceNotFoundException {
-        final MBeanServer ns = getInterceptorOrNullFor(name);
-        if (ns == null) // name cannot be null here.
-            throw new InstanceNotFoundException(String.valueOf(name));
-        return ns;
-    }
-
-    // sanity checks
-    void validateHandlerNameFor(String key, ObjectName name) {
-        if (key == null || key.equals(""))
-            throw new IllegalArgumentException("invalid key for "+name+": "+key);
-        final ObjectName handlerName = getHandlerNameFor(key);
-        if (!name.equals(handlerName))
-            throw new IllegalArgumentException("bad handler name: "+name+
-                    ". Should be: "+handlerName);
-    }
-
-    // Called by the DefaultMBeanServerInterceptor when an instance
-    // of JMXNamespace (or a subclass of it) is registered as an MBean.
-    // This method is usually invoked from within the repository lock,
-    // hence the necessity of the postRegisterQueue.
-    public void addInterceptorFor(ObjectName name, N jmxNamespace,
-            Queue<Runnable> postRegisterQueue) {
-        final String key = getHandlerKey(name);
-        validateHandlerNameFor(key,name);
-        synchronized (handlerMap) {
-            final T exists =
-                    handlerMap.get(key);
-            if (exists != null)
-                throw new IllegalArgumentException(key+
-                        ": handler already exists");
-
-            final T ns = createInterceptorFor(key,name,jmxNamespace,
-                    postRegisterQueue);
-            handlerMap.put(key,ns);
-        }
-    }
-
-    // Called by the DefaultMBeanServerInterceptor when an instance
-    // of JMXNamespace (or a subclass of it) is deregistered.
-    // This method is usually invoked from within the repository lock,
-    // hence the necessity of the postDeregisterQueue.
-    public void removeInterceptorFor(ObjectName name, N jmxNamespace,
-            Queue<Runnable> postDeregisterQueue) {
-        final String key = getHandlerKey(name);
-        final T ns;
-        synchronized(handlerMap) {
-            ns = handlerMap.remove(key);
-        }
-        interceptorReleased(ns,postDeregisterQueue);
-    }
-
-    // Get the interceptor for that key.
-    T getInterceptor(String key) {
-        synchronized (handlerMap) {
-            return handlerMap.get(key);
-        }
-    }
-
-    // We return an array of keys, which makes it possible to make
-    // concurrent modifications of the handlerMap, provided that
-    // the code which loops over the keys is prepared to handle null
-    // interceptors.
-    // See declaration of handlerMap above, and see also query() in
-    // DomainDispatcher
-    //
-    public String[] getKeys() {
-        synchronized (handlerMap) {
-            final int size = handlerMap.size();
-            return handlerMap.keySet().toArray(new String[size]);
-        }
-    }
-
-    // From MBeanServer
-    public final ObjectInstance createMBean(String className, ObjectName name)
-            throws ReflectionException, InstanceAlreadyExistsException,
-                   MBeanRegistrationException, MBeanException,
-                   NotCompliantMBeanException {
-        return getInterceptorForCreate(name).createMBean(className,name);
-    }
-
-    // From MBeanServer
-    public final ObjectInstance createMBean(String className, ObjectName name,
-                                      ObjectName loaderName)
-            throws ReflectionException, InstanceAlreadyExistsException,
-                   MBeanRegistrationException, MBeanException,
-                   NotCompliantMBeanException, InstanceNotFoundException{
-        return getInterceptorForCreate(name).createMBean(className,name,loaderName);
-    }
-
-    // From MBeanServer
-    public final ObjectInstance createMBean(String className, ObjectName name,
-                                      Object params[], String signature[])
-            throws ReflectionException, InstanceAlreadyExistsException,
-                   MBeanRegistrationException, MBeanException,
-                   NotCompliantMBeanException{
-        return getInterceptorForCreate(name).
-                createMBean(className,name,params,signature);
-    }
-
-    // From MBeanServer
-    public final ObjectInstance createMBean(String className, ObjectName name,
-                                      ObjectName loaderName, Object params[],
-                                      String signature[])
-            throws ReflectionException, InstanceAlreadyExistsException,
-                   MBeanRegistrationException, MBeanException,
-                   NotCompliantMBeanException, InstanceNotFoundException{
-        return getInterceptorForCreate(name).createMBean(className,name,loaderName,
-                                                   params,signature);
-    }
-
-    // From MBeanServer
-    public final ObjectInstance registerMBean(Object object, ObjectName name)
-            throws InstanceAlreadyExistsException, MBeanRegistrationException,
-                   NotCompliantMBeanException {
-        return getInterceptorForCreate(name).registerMBean(object,name);
-    }
-
-    // From MBeanServer
-    public final void unregisterMBean(ObjectName name)
-            throws InstanceNotFoundException, MBeanRegistrationException {
-        getInterceptorForInstance(name).unregisterMBean(name);
-    }
-
-    // From MBeanServer
-    public final ObjectInstance getObjectInstance(ObjectName name)
-            throws InstanceNotFoundException {
-        return getInterceptorForInstance(name).getObjectInstance(name);
-    }
-
-    // From MBeanServer
-    public final Set<ObjectInstance> queryMBeans(ObjectName name,
-            QueryExp query) {
-        final QueryInterceptor queryInvoker =
-                getInterceptorForQuery(name);
-        if (queryInvoker == null)  return Collections.emptySet();
-        else return queryInvoker.queryMBeans(name,query);
-    }
-
-    // From MBeanServer
-    public final Set<ObjectName> queryNames(ObjectName name, QueryExp query) {
-        final QueryInterceptor queryInvoker =
-                getInterceptorForQuery(name);
-        if (queryInvoker == null)  return Collections.emptySet();
-        else return queryInvoker.queryNames(name,query);
-    }
-
-    // From MBeanServer
-    public final boolean isRegistered(ObjectName name) {
-        final MBeanServer mbs = getInterceptorOrNullFor(name);
-        if (mbs == null) return false;
-        else return mbs.isRegistered(name);
-    }
-
-    // From MBeanServer
-    public Integer getMBeanCount() {
-        return getNextInterceptor().getMBeanCount();
-    }
-
-    // From MBeanServer
-    public final Object getAttribute(ObjectName name, String attribute)
-            throws MBeanException, AttributeNotFoundException,
-                   InstanceNotFoundException, ReflectionException {
-        return getInterceptorForInstance(name).getAttribute(name,attribute);
-    }
-
-    // From MBeanServer
-    public final AttributeList getAttributes(ObjectName name,
-            String[] attributes)
-            throws InstanceNotFoundException, ReflectionException {
-        return getInterceptorForInstance(name).getAttributes(name,attributes);
-    }
-
-    // From MBeanServer
-    public final void setAttribute(ObjectName name, Attribute attribute)
-            throws InstanceNotFoundException, AttributeNotFoundException,
-                   InvalidAttributeValueException, MBeanException,
-                   ReflectionException {
-        getInterceptorForInstance(name).setAttribute(name,attribute);
-    }
-
-    // From MBeanServer
-    public final AttributeList setAttributes(ObjectName name,
-                                       AttributeList attributes)
-        throws InstanceNotFoundException, ReflectionException {
-        return getInterceptorForInstance(name).setAttributes(name,attributes);
-    }
-
-    // From MBeanServer
-    public final Object invoke(ObjectName name, String operationName,
-                         Object params[], String signature[])
-            throws InstanceNotFoundException, MBeanException,
-                   ReflectionException {
-        return getInterceptorForInstance(name).invoke(name,operationName,params,
-                signature);
-    }
-
-    // From MBeanServer
-    public String getDefaultDomain() {
-        return getNextInterceptor().getDefaultDomain();
-    }
-
-    /**
-     * Returns the list of domains in which any MBean is currently
-     * registered.
-     */
-    public abstract String[] getDomains();
-
-    // From MBeanServer
-    public final void addNotificationListener(ObjectName name,
-                                        NotificationListener listener,
-                                        NotificationFilter filter,
-                                        Object handback)
-            throws InstanceNotFoundException {
-        getInterceptorForInstance(name).
-                addNotificationListener(name,listener,filter,
-                handback);
-    }
-
-
-    // From MBeanServer
-    public final void addNotificationListener(ObjectName name,
-                                        ObjectName listener,
-                                        NotificationFilter filter,
-                                        Object handback)
-            throws InstanceNotFoundException {
-        getInterceptorForInstance(name).
-                addNotificationListener(name,listener,filter,
-                handback);
-    }
-
-    // From MBeanServer
-    public final void removeNotificationListener(ObjectName name,
-                                           ObjectName listener)
-        throws InstanceNotFoundException, ListenerNotFoundException {
-        getInterceptorForInstance(name).
-                removeNotificationListener(name,listener);
-    }
-
-    // From MBeanServer
-    public final void removeNotificationListener(ObjectName name,
-                                           ObjectName listener,
-                                           NotificationFilter filter,
-                                           Object handback)
-            throws InstanceNotFoundException, ListenerNotFoundException {
-        getInterceptorForInstance(name).
-                removeNotificationListener(name,listener,filter,
-                handback);
-    }
-
-
-    // From MBeanServer
-    public final void removeNotificationListener(ObjectName name,
-                                           NotificationListener listener)
-            throws InstanceNotFoundException, ListenerNotFoundException {
-        getInterceptorForInstance(name).
-                removeNotificationListener(name,listener);
-    }
-
-    // From MBeanServer
-    public final void removeNotificationListener(ObjectName name,
-                                           NotificationListener listener,
-                                           NotificationFilter filter,
-                                           Object handback)
-            throws InstanceNotFoundException, ListenerNotFoundException {
-        getInterceptorForInstance(name).
-                removeNotificationListener(name,listener,filter,
-                handback);
-    }
-
-    // From MBeanServer
-    public final MBeanInfo getMBeanInfo(ObjectName name)
-            throws InstanceNotFoundException, IntrospectionException,
-                   ReflectionException {
-        return getInterceptorForInstance(name).getMBeanInfo(name);
-    }
-
-
-    // From MBeanServer
-    public final boolean isInstanceOf(ObjectName name, String className)
-            throws InstanceNotFoundException {
-        return getInterceptorForInstance(name).isInstanceOf(name,className);
-    }
-
-    // From MBeanServer
-    public final ClassLoader getClassLoaderFor(ObjectName mbeanName)
-        throws InstanceNotFoundException {
-        return getInterceptorForInstance(mbeanName).
-                getClassLoaderFor(mbeanName);
-    }
-
-    // From MBeanServer
-    public final ClassLoader getClassLoader(ObjectName loaderName)
-        throws InstanceNotFoundException {
-        return getInterceptorForInstance(loaderName).
-                getClassLoader(loaderName);
-    }
-
-}
--- a/src/share/classes/com/sun/jmx/interceptor/DomainDispatchInterceptor.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,350 +0,0 @@
-/*
- * 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 com.sun.jmx.interceptor;
-
-import com.sun.jmx.defaults.JmxProperties;
-import com.sun.jmx.mbeanserver.MBeanInstantiator;
-import com.sun.jmx.mbeanserver.Repository;
-import com.sun.jmx.mbeanserver.Util;
-import com.sun.jmx.namespace.DomainInterceptor;
-import java.util.Queue;
-import java.util.Set;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerDelegate;
-import javax.management.ObjectName;
-import javax.management.QueryExp;
-import javax.management.namespace.JMXDomain;
-import static javax.management.namespace.JMXNamespaces.NAMESPACE_SEPARATOR;
-
-/**
- * A dispatcher that dispatch incoming MBeanServer requests to
- * DomainInterceptors.
- * <p><b>
- * This API is a Sun internal API and is subject to changes without notice.
- * </b></p>
- * @since 1.7
- */
-//
-// See comments in  DispatchInterceptor.
-//
-class DomainDispatchInterceptor
-        extends DispatchInterceptor<DomainInterceptor, JMXDomain> {
-
-    /**
-     * A logger for this class.
-     **/
-    private static final Logger LOG = JmxProperties.NAMESPACE_LOGGER;
-
-    private static final ObjectName ALL_DOMAINS =
-            JMXDomain.getDomainObjectName("*");
-
-
-    /**
-     *  A QueryInterceptor that perform & aggregates queries spanning several
-     *  domains.
-     */
-    final static class AggregatingQueryInterceptor extends QueryInterceptor {
-
-        private final DomainDispatchInterceptor parent;
-        AggregatingQueryInterceptor(DomainDispatchInterceptor dispatcher) {
-            super(dispatcher.nextInterceptor);
-            parent = dispatcher;
-        }
-
-        /**
-         * Perform queryNames or queryMBeans, depending on which QueryInvoker
-         * is passed as argument. This is closures without closures.
-         **/
-        @Override
-        <T> Set<T> query(ObjectName pattern, QueryExp query,
-                QueryInvoker<T> invoker, MBeanServer localNamespace) {
-            final Set<T> local = invoker.query(localNamespace, pattern, query);
-
-            // Add all matching MBeans from local namespace.
-            final Set<T> res = Util.cloneSet(local);
-
-            if (pattern == null) pattern = ObjectName.WILDCARD;
-            final boolean all = pattern.getDomain().equals("*");
-
-            final String domain = pattern.getDomain();
-
-            // If there's no domain pattern, just include the pattern's domain.
-            // Otherwiae, loop over all virtual domains (parent.getKeys()).
-            final String[] keys =
-                (pattern.isDomainPattern() ?
-                    parent.getKeys() : new String[]{domain});
-
-            // Add all matching MBeans from each virtual domain
-            //
-            for (String key : keys) {
-                // Only invoke those virtual domain which are selected
-                // by the domain pattern
-                //
-                if (!all && !Util.isDomainSelected(key, domain))
-                    continue;
-
-                try {
-                    final MBeanServer mbs = parent.getInterceptor(key);
-
-                    // mbs can be null if the interceptor was removed
-                    // concurrently...
-                    // See handlerMap and getKeys() in DispatchInterceptor
-                    //
-                    if (mbs == null) continue;
-
-                    // If the domain is selected, we can replace the pattern
-                    // by the actual domain. This is safer if we want to avoid
-                    // a domain (which could be backed up by an MBeanServer) to
-                    // return names from outside the domain.
-                    // So instead of asking the domain handler for "foo" to
-                    // return all names which match "?o*:type=Bla,*" we're
-                    // going to ask it to return all names which match
-                    // "foo:type=Bla,*"
-                    //
-                    final ObjectName subPattern = pattern.withDomain(key);
-                    res.addAll(invoker.query(mbs, subPattern, query));
-                } catch (Exception x) {
-                    LOG.finest("Ignoring exception " +
-                            "when attempting to query namespace "+key+": "+x);
-                    continue;
-                }
-            }
-            return res;
-        }
-    }
-
-    private final DefaultMBeanServerInterceptor nextInterceptor;
-    private final String mbeanServerName;
-    private final MBeanServerDelegate delegate;
-
-    /**
-     * Creates a DomainDispatchInterceptor with the specified
-     * repository instance.
-     *
-     * @param outer A pointer to the MBeanServer object that must be
-     *        passed to the MBeans when invoking their
-     *        {@link javax.management.MBeanRegistration} interface.
-     * @param delegate A pointer to the MBeanServerDelegate associated
-     *        with the new MBeanServer. The new MBeanServer must register
-     *        this MBean in its MBean repository.
-     * @param instantiator The MBeanInstantiator that will be used to
-     *        instantiate MBeans and take care of class loading issues.
-     * @param repository The repository to use for this MBeanServer
-     */
-    public DomainDispatchInterceptor(MBeanServer         outer,
-                            MBeanServerDelegate delegate,
-                            MBeanInstantiator   instantiator,
-                            Repository          repository,
-                            NamespaceDispatchInterceptor namespaces)  {
-           nextInterceptor = new DefaultMBeanServerInterceptor(outer,
-                   delegate, instantiator,repository,namespaces);
-           mbeanServerName = Util.getMBeanServerSecurityName(delegate);
-           this.delegate = delegate;
-    }
-
-    final boolean isLocalHandlerNameFor(String domain,
-            ObjectName handlerName) {
-        if (domain == null) return true;
-        return handlerName.getDomain().equals(domain) &&
-               JMXDomain.TYPE_ASSIGNMENT.equals(
-               handlerName.getKeyPropertyListString());
-    }
-
-    @Override
-    void validateHandlerNameFor(String key, ObjectName name) {
-        super.validateHandlerNameFor(key,name);
-        final String[] domains = nextInterceptor.getDomains();
-        for (int i=0;i<domains.length;i++) {
-            if (domains[i].equals(key))
-                throw new IllegalArgumentException("domain "+key+
-                        " is not empty");
-        }
-    }
-
-    @Override
-    final MBeanServer getInterceptorOrNullFor(ObjectName name) {
-
-        if (name == null) return nextInterceptor;
-
-        final String domain = name.getDomain();
-        if (domain.endsWith(NAMESPACE_SEPARATOR))
-            return nextInterceptor; // This can be a namespace handler.
-        if (domain.contains(NAMESPACE_SEPARATOR))
-            return null; // shouldn't reach here.
-        if (isLocalHandlerNameFor(domain,name)) {
-            // This is the name of a JMXDomain MBean. Return nextInterceptor.
-            LOG.finer("dispatching to local namespace");
-            return nextInterceptor;
-        }
-
-        final DomainInterceptor ns = getInterceptor(domain);
-        if (ns == null) {
-            // no JMXDomain found for that domain - return nextInterceptor.
-            if (LOG.isLoggable(Level.FINER)) {
-                LOG.finer("dispatching to local namespace: " + domain);
-            }
-            return getNextInterceptor();
-        }
-
-        if (LOG.isLoggable(Level.FINER)) {
-            LOG.finer("dispatching to domain: " + domain);
-        }
-        return ns;
-    }
-
-    // This method returns true if the given pattern must be evaluated against
-    // several interceptors. This happens when either:
-    //
-    //   a) the pattern can select several domains (it's null, or it's a
-    //        domain pattern)
-    //   or b) it's not a domain pattern, but it might select the name of a
-    //        JMXDomain MBean in charge of that domain. Since the JMXDomain
-    //        MBean is located in the nextInterceptor, the pattern might need
-    //        to be evaluated on two interceptors.
-    //
-    // 1. When this method returns false, the query is evaluated on a single
-    // interceptor:
-    //    The interceptor for pattern.getDomain(), if there is one,
-    //    or the next interceptor, if there is none.
-    //
-    // 2. When this method returns true, we loop over all the domain
-    // interceptors:
-    //    in the list, and if the domain pattern matches the interceptor domain
-    //    we evaluate the query on that interceptor and aggregate the results.
-    //    Eventually we also evaluate the pattern against the next interceptor.
-    //
-    // See getInterceptorForQuery below.
-    //
-    private boolean multipleQuery(ObjectName pattern) {
-        // case a) above
-        if (pattern == null) return true;
-        if (pattern.isDomainPattern()) return true;
-
-        // case b) above.
-        //
-        // This is a bit of a hack. If there's any chance that a JMXDomain
-        // MBean name is selected by the given pattern then we must include
-        // the local namespace in our search.
-        //
-        // Returning true will have this effect. see 2. above.
-        //
-        if (pattern.apply(ALL_DOMAINS.withDomain(pattern.getDomain())))
-            return true;
-
-        return false;
-    }
-
-    @Override
-    final QueryInterceptor getInterceptorForQuery(ObjectName pattern) {
-
-        // Check if we need to aggregate.
-        if (multipleQuery(pattern))
-            return new AggregatingQueryInterceptor(this);
-
-        // We don't need to aggregate: do the "simple" thing...
-        final String domain = pattern.getDomain();
-
-        // Do we have a virtual domain?
-        final DomainInterceptor ns = getInterceptor(domain);
-        if (ns != null) {
-            if (LOG.isLoggable(Level.FINER))
-                LOG.finer("dispatching to domain: " + domain);
-            return new QueryInterceptor(ns);
-        }
-
-        // We don't have a virtual domain. Send to local domains.
-        if (LOG.isLoggable(Level.FINER))
-             LOG.finer("dispatching to local namespace: " + domain);
-        return new QueryInterceptor(nextInterceptor);
-    }
-
-    @Override
-    final ObjectName getHandlerNameFor(String key) {
-        return JMXDomain.getDomainObjectName(key);
-    }
-
-    @Override
-    final public String getHandlerKey(ObjectName name) {
-        return name.getDomain();
-    }
-
-    @Override
-    final DomainInterceptor createInterceptorFor(String key,
-            ObjectName name, JMXDomain handler,
-            Queue<Runnable> postRegisterQueue) {
-        final DomainInterceptor ns =
-                new DomainInterceptor(mbeanServerName,handler,key);
-        ns.addPostRegisterTask(postRegisterQueue, delegate);
-        if (LOG.isLoggable(Level.FINER)) {
-            LOG.finer("DomainInterceptor created: "+ns);
-        }
-        return ns;
-    }
-
-    @Override
-    final void interceptorReleased(DomainInterceptor interceptor,
-            Queue<Runnable> postDeregisterQueue) {
-        interceptor.addPostDeregisterTask(postDeregisterQueue, delegate);
-    }
-
-    @Override
-    final DefaultMBeanServerInterceptor getNextInterceptor() {
-        return nextInterceptor;
-    }
-
-    /**
-     * Returns the list of domains in which any MBean is currently
-     * registered.
-     */
-    @Override
-    public String[] getDomains() {
-        // A JMXDomain is registered in its own domain.
-        // Therefore, nextInterceptor.getDomains() contains all domains.
-        // In addition, nextInterceptor will perform the necessary
-        // MBeanPermission checks for getDomains().
-        //
-        return nextInterceptor.getDomains();
-    }
-
-    /**
-     * Returns the number of MBeans registered in the MBean server.
-     */
-    @Override
-    public Integer getMBeanCount() {
-        int count = getNextInterceptor().getMBeanCount();
-        final String[] keys = getKeys();
-        for (String key:keys) {
-            final MBeanServer mbs = getInterceptor(key);
-            if (mbs == null) continue;
-            count += mbs.getMBeanCount();
-        }
-        return count;
-    }
-}
--- a/src/share/classes/com/sun/jmx/interceptor/MBeanServerInterceptorSupport.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
- * 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 com.sun.jmx.interceptor;
-
-import java.io.ObjectInputStream;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.ObjectName;
-import javax.management.OperationsException;
-import javax.management.ReflectionException;
-import javax.management.loading.ClassLoaderRepository;
-
-/**
- * An abstract class for MBeanServerInterceptorSupport.
- * Some methods in MBeanServerInterceptor should never be called.
- * This base class provides an implementation of these methods that simply
- * throw an {@link UnsupportedOperationException}.
- * <p><b>
- * This API is a Sun internal API and is subject to changes without notice.
- * </b></p>
- * @since 1.7
- */
-public abstract class MBeanServerInterceptorSupport
-        implements MBeanServerInterceptor {
-    /**
-     * This method should never be called.
-     * Throws UnsupportedOperationException.
-     */
-    public Object instantiate(String className)
-            throws ReflectionException, MBeanException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-    /**
-     * This method should never be called.
-     * Throws UnsupportedOperationException.
-     */
-    public Object instantiate(String className, ObjectName loaderName)
-            throws ReflectionException, MBeanException,
-            InstanceNotFoundException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-    /**
-     * This method should never be called.
-     * Throws UnsupportedOperationException.
-     */
-    public Object instantiate(String className, Object[] params,
-            String[] signature) throws ReflectionException, MBeanException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-    /**
-     * This method should never be called.
-     * Throws UnsupportedOperationException.
-     */
-    public Object instantiate(String className, ObjectName loaderName,
-            Object[] params, String[] signature)
-            throws ReflectionException, MBeanException,
-            InstanceNotFoundException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-    /**
-     * This method should never be called.
-     * Throws UnsupportedOperationException.
-     */
-    @Deprecated
-    public ObjectInputStream deserialize(ObjectName name, byte[] data)
-            throws InstanceNotFoundException, OperationsException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-    /**
-     * This method should never be called.
-     * Throws UnsupportedOperationException.
-     */
-    @Deprecated
-    public ObjectInputStream deserialize(String className, byte[] data)
-            throws OperationsException, ReflectionException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-    /**
-     * This method should never be called.
-     * Throws UnsupportedOperationException.
-     */
-    @Deprecated
-    public ObjectInputStream deserialize(String className,
-            ObjectName loaderName, byte[] data)
-            throws InstanceNotFoundException, OperationsException,
-            ReflectionException {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-    /**
-     * This method should never be called.
-     * Throws UnsupportedOperationException.
-     */
-    public ClassLoaderRepository getClassLoaderRepository() {
-        throw new UnsupportedOperationException("Not applicable.");
-    }
-
-}
--- a/src/share/classes/com/sun/jmx/interceptor/NamespaceDispatchInterceptor.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,297 +0,0 @@
-/*
- * 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 com.sun.jmx.interceptor;
-
-import com.sun.jmx.defaults.JmxProperties;
-import com.sun.jmx.mbeanserver.MBeanInstantiator;
-import com.sun.jmx.mbeanserver.Repository;
-import com.sun.jmx.mbeanserver.Util;
-import com.sun.jmx.namespace.NamespaceInterceptor;
-
-import java.util.Queue;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerDelegate;
-import javax.management.ObjectName;
-import javax.management.RuntimeOperationsException;
-import javax.management.namespace.JMXDomain;
-import javax.management.namespace.JMXNamespace;
-import static javax.management.namespace.JMXNamespaces.NAMESPACE_SEPARATOR;
-
-/**
- * A dispatcher that dispatches to NamespaceInterceptors.
- * <p><b>
- * This API is a Sun internal API and is subject to changes without notice.
- * </b></p>
- * @since 1.7
- */
-public class NamespaceDispatchInterceptor
-        extends DispatchInterceptor<NamespaceInterceptor, JMXNamespace> {
-
-    /**
-     * A logger for this class.
-     **/
-    private static final Logger LOG = JmxProperties.NAMESPACE_LOGGER;
-
-    private static final int NAMESPACE_SEPARATOR_LENGTH =
-            NAMESPACE_SEPARATOR.length();
-    private static final ObjectName X3 = ObjectName.valueOf("x:x=x");
-
-    private final DomainDispatchInterceptor nextInterceptor;
-    private final String           serverName;
-
-    /**
-     * Creates a NamespaceDispatchInterceptor with the specified
-     * repository instance.
-     * <p>Do not forget to call <code>initialize(outer,delegate)</code>
-     * before using this object.
-     *
-     * @param outer A pointer to the MBeanServer object that must be
-     *        passed to the MBeans when invoking their
-     *        {@link javax.management.MBeanRegistration} interface.
-     * @param delegate A pointer to the MBeanServerDelegate associated
-     *        with the new MBeanServer. The new MBeanServer must register
-     *        this MBean in its MBean repository.
-     * @param instantiator The MBeanInstantiator that will be used to
-     *        instantiate MBeans and take care of class loading issues.
-     * @param repository The repository to use for this MBeanServer
-     */
-    public NamespaceDispatchInterceptor(MBeanServer         outer,
-                               MBeanServerDelegate delegate,
-                               MBeanInstantiator   instantiator,
-                               Repository          repository)  {
-           nextInterceptor = new DomainDispatchInterceptor(outer,delegate,
-                   instantiator,repository,this);
-           serverName = Util.getMBeanServerSecurityName(delegate);
-    }
-
-    /**
-     * Get first name space in ObjectName path. Ignore leading namespace
-     * separators. Includes the trailing //.
-     *
-     * Examples:
-     * <pre>
-     *  For ObjectName:                   Returns:
-     *  foo//bar//baz:x=x         ->      "foo//"
-     *  foo//:type=JMXNamespace   ->      "foo//"
-     *  foo//:x=x                 ->      "foo//"
-     *  foo////:x=x               ->      "foo//"
-     *  //foo//bar//baz:x=x       ->      "//"
-     *  ////foo//bar//baz:x=x     ->      "//"
-     *  //:x=x                    ->      "//"
-     *  foo:x=x                   ->      ""
-     *  (null)                    ->      ""
-     *  :x=x                      ->      ""
-     *
-     * </pre>
-     **/
-    static String getFirstNamespaceWithSlash(ObjectName name) {
-        if (name == null) return "";
-        final String domain = name.getDomain();
-        if (domain.equals("")) return "";
-
-        // go to next separator
-        final int end = domain.indexOf(NAMESPACE_SEPARATOR);
-        if (end == -1) return ""; // no namespace
-
-        // This is the first element in the namespace path.
-        final String namespace =
-                domain.substring(0,end+NAMESPACE_SEPARATOR_LENGTH);
-
-        return namespace;
-    }
-
-    /**
-     * Called by the DefaultMBeanServerInterceptor, just before adding an
-     * MBean to the repository.
-     *
-     * @param resource the MBean to be registered.
-     * @param logicalName the name of the MBean to be registered.
-     */
-    final void checkLocallyRegistrable(Object resource,
-            ObjectName logicalName) {
-        if (!(resource instanceof JMXNamespace) &&
-                logicalName.getDomain().contains(NAMESPACE_SEPARATOR))
-            throw new IllegalArgumentException(String.valueOf(logicalName)+
-                    ": Invalid ObjectName for an instance of " +
-                    resource.getClass().getName());
-    }
-
-    // Removes the trailing //. namespaceWithSlash should be either
-    // "" or a namespace path ending with //.
-    //
-    private final String getKeyFor(String namespaceWithSlash) {
-        final int end = namespaceWithSlash.length() -
-                NAMESPACE_SEPARATOR_LENGTH;
-        if (end <= 0) return "";
-        final String key = namespaceWithSlash.substring(0,end);
-        return key;
-    }
-
-    @Override
-    final MBeanServer getInterceptorOrNullFor(ObjectName name) {
-        final String namespace = getFirstNamespaceWithSlash(name);
-
-        // Leading separators should trigger instance not found exception.
-        // returning null here has this effect.
-        //
-        if (namespace.equals(NAMESPACE_SEPARATOR)) {
-            LOG.finer("ObjectName starts with: "+namespace);
-            return null;
-        }
-
-        // namespace="" means that there was no namespace path in the
-        //   ObjectName. => delegate to the next interceptor (local MBS)
-        // name.getDomain()=namespace means that we have an ObjectName of
-        //   the form blah//:x=x. This is either a JMXNamespace or a non
-        //   existent MBean. => delegate to the next interceptor (local MBS)
-        if (namespace.equals("") || name.getDomain().equals(namespace)) {
-            LOG.finer("dispatching to local name space");
-            return nextInterceptor;
-        }
-
-        // There was a namespace path in the ObjectName. Returns the
-        // interceptor that handles it, or null if there is no such
-        // interceptor.
-        final String key = getKeyFor(namespace);
-        final NamespaceInterceptor ns = getInterceptor(key);
-        if (LOG.isLoggable(Level.FINER)) {
-            if (ns != null) {
-                LOG.finer("dispatching to name space: " + key);
-            } else {
-                LOG.finer("no handler for: " + key);
-            }
-        }
-        return ns;
-    }
-
-    @Override
-    final QueryInterceptor getInterceptorForQuery(ObjectName pattern) {
-        final String namespace = getFirstNamespaceWithSlash(pattern);
-
-        // Leading separators should trigger instance not found exception.
-        // returning null here has this effect.
-        //
-        if (namespace.equals(NAMESPACE_SEPARATOR)) {
-            LOG.finer("ObjectName starts with: "+namespace);
-            return null;
-        }
-
-        // namespace="" means that there was no namespace path in the
-        //   ObjectName. => delegate to the next interceptor (local MBS)
-        // name.getDomain()=namespace means that we have an ObjectName of
-        //   the form blah//:x=x. This is either a JMXNamespace or a non
-        //   existent MBean. => delegate to the next interceptor (local MBS)
-        if (namespace.equals("") || pattern.getDomain().equals(namespace)) {
-            LOG.finer("dispatching to local name space");
-            return new QueryInterceptor(nextInterceptor);
-        }
-
-        // This is a 'hack' to check whether the first namespace is a pattern.
-        // We wan to throw RTOE wrapping IAE in that case
-        if (X3.withDomain(namespace).isDomainPattern()) {
-            throw new RuntimeOperationsException(
-                new IllegalArgumentException("Pattern not allowed in namespace path"));
-        }
-
-        // There was a namespace path in the ObjectName. Returns the
-        // interceptor that handles it, or null if there is no such
-        // interceptor.
-        //
-        final String key = getKeyFor(namespace);
-        final NamespaceInterceptor ns = getInterceptor(key);
-        if (LOG.isLoggable(Level.FINER)) {
-            if (ns != null) {
-                LOG.finer("dispatching to name space: " + key);
-            } else {
-                LOG.finer("no handler for: " + key);
-            }
-        }
-        if (ns == null) return null;
-        return new QueryInterceptor(ns);
-    }
-
-    @Override
-    final ObjectName getHandlerNameFor(String key) {
-        return ObjectName.valueOf(key+NAMESPACE_SEPARATOR,
-                    "type", JMXNamespace.TYPE);
-    }
-
-    @Override
-    final public String getHandlerKey(ObjectName name) {
-        final String namespace = getFirstNamespaceWithSlash(name);
-        // namespace is either "" or a namespace ending with //
-        return getKeyFor(namespace);
-    }
-
-    @Override
-    final NamespaceInterceptor createInterceptorFor(String key,
-            ObjectName name, JMXNamespace handler,
-            Queue<Runnable> postRegisterQueue) {
-        final NamespaceInterceptor ns =
-                new NamespaceInterceptor(serverName,handler,key);
-        if (LOG.isLoggable(Level.FINER)) {
-            LOG.finer("NamespaceInterceptor created: "+ns);
-        }
-        return ns;
-    }
-
-    @Override
-    final DomainDispatchInterceptor getNextInterceptor() {
-        return nextInterceptor;
-    }
-
-    /**
-     * Returns the list of domains in which any MBean is currently
-     * registered.
-     */
-    @Override
-    public String[] getDomains() {
-        return nextInterceptor.getDomains();
-    }
-
-    @Override
-    public void addInterceptorFor(ObjectName name, JMXNamespace handler,
-            Queue<Runnable> postRegisterQueue) {
-        if (handler instanceof JMXDomain)
-            nextInterceptor.addInterceptorFor(name,
-                    (JMXDomain)handler,postRegisterQueue);
-        else super.addInterceptorFor(name,handler,postRegisterQueue);
-    }
-
-    @Override
-    public void removeInterceptorFor(ObjectName name, JMXNamespace handler,
-            Queue<Runnable> postDeregisterQueue) {
-        if (handler instanceof JMXDomain)
-            nextInterceptor.removeInterceptorFor(name,(JMXDomain)handler,
-                    postDeregisterQueue);
-        else super.removeInterceptorFor(name,handler,postDeregisterQueue);
-    }
-
-
-}
--- a/src/share/classes/com/sun/jmx/interceptor/SingleMBeanForwarder.java	Wed Nov 25 21:27:06 2009 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,442 +0,0 @@
-/*
- * 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 com.sun.jmx.interceptor;
-
-import com.sun.jmx.mbeanserver.Util;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Set;
-import java.util.TreeSet;
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.AttributeNotFoundException;
-import javax.management.DynamicMBean;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.InstanceNotFoundException;
-import javax.management.IntrospectionException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanRegistrationException;
-import javax.management.MBeanServer;
-import javax.management.NotCompliantMBeanException;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-import javax.management.QueryExp;
-import javax.management.ReflectionException;
-import javax.management.namespace.JMXNamespaces;
-import javax.management.namespace.MBeanServerSupport;
-import javax.management.remote.IdentityMBeanServerForwarder;
-
-/**
- * <p>An {@link MBeanServerForwarder} that simulates the existence of a
- * given MBean.  Requests for that MBean, call it X, are intercepted by the
- * forwarder, and requests for any other MBean are forwarded to the next
- * forwarder in the chain.  Requests such as queryNames which can span both the
- * X and other MBeans are handled by merging the results for X with the results
- * from the next forwarder, unless the "visible" parameter is false, in which
- * case X is invisible to such requests.</p>
- */
-public class SingleMBeanForwarder extends IdentityMBeanServerForwarder {
-
-    private final ObjectName mbeanName;
-    private final boolean visible;
-    private DynamicMBean mbean;
-
-    private MBeanServer mbeanMBS = new MBeanServerSupport() {
-
-        @Override
-        public DynamicMBean getDynamicMBeanFor(ObjectName name)
-                throws InstanceNotFoundException {
-            if (mbeanName.equals(name)) {
-                return mbean;
-            } else {
-                throw new InstanceNotFoundException(name.toString());
-            }
-        }
-
-        @Override
-        protected Set<ObjectName> getNames() {
-            return Collections.singleton(mbeanName);
-        }
-
-        @Override
-        public NotificationEmitter getNotificationEmitterFor(
-                ObjectName name) {
-            if (mbean instanceof NotificationEmitter)
-                return (NotificationEmitter) mbean;
-            return null;
-        }
-
-        // This will only be called if mbeanName has an empty domain.
-        // In that case a getAttribute (e.g.) of that name will have the
-        // domain replaced by MBeanServerSupport with the default domain,
-        // so we must be sure that the default domain is empty too.
-        @Override
-        public String getDefaultDomain() {
-            return mbeanName.getDomain();
-        }
-    };
-
-    public SingleMBeanForwarder(
-            ObjectName mbeanName, DynamicMBean mbean, boolean visible) {
-        this.mbeanName = mbeanName;
-        this.visible = visible;
-        setSingleMBean(mbean);
-    }
-
-    protected void setSingleMBean(DynamicMBean mbean) {
-        this.mbean = mbean;
-    }
-
-    @Override
-    public void addNotificationListener(ObjectName name, ObjectName listener,
-                                         NotificationFilter filter,
-                                         Object handback)
-            throws InstanceNotFoundException {
-        if (mbeanName.equals(name))
-            mbeanMBS.addNotificationListener(name, listener, filter, handback);
-        else
-            super.addNotificationListener(name, listener, filter, handback);
-    }
-
-    @Override
-    public void addNotificationListener(ObjectName name,
-                                         NotificationListener listener,
-                                         NotificationFilter filter,
-                                         Object handback)
-            throws InstanceNotFoundException {
-        if (mbeanName.equals(name))
-            mbeanMBS.addNotificationListener(name, listener, filter, handback);
-        else
-            super.addNotificationListener(name, listener, filter, handback);
-    }
-
-    @Override
-    public ObjectInstance createMBean(String className, ObjectName name,
-                                       ObjectName loaderName, Object[] params,
-                                       String[] signature)
-            throws ReflectionException,
-                   InstanceAlreadyExistsException,
-                   MBeanRegistrationException,
-                   MBeanException,
-                   NotCompliantMBeanException,
-                   InstanceNotFoundException {
-        if (mbeanName.equals(name))
-            throw new InstanceAlreadyExistsException(mbeanName.toString());
-        else
-            return super.createMBean(className, name, loaderName, params, signature);
-    }
-
-    @Override
-    public ObjectInstance createMBean(String className, ObjectName name,
-                                       Object[] params, String[] signature)
-            throws ReflectionException, InstanceAlreadyExistsException,
-                   MBeanRegistrationException, MBeanException,
-                   NotCompliantMBeanException {
-        if (mbeanName.equals(name))
-            throw new InstanceAlreadyExistsException(mbeanName.toString());
-        return super.createMBean(className, name, params, signature);
-    }
-
-    @Override
-    public ObjectInstance createMBean(String className, ObjectName name,
-                                       ObjectName loaderName)
-            throws ReflectionException,
-                   InstanceAlreadyExistsException,
-                   MBeanRegistrationException,
-                   MBeanException,
-                   NotCompliantMBeanException,
-                   InstanceNotFoundException {
-        if (mbeanName.equals(name))
-            throw new InstanceAlreadyExistsException(mbeanName.toString());
-        return super.createMBean(className, name, loaderName);
-    }
-
-    @Override
-    public ObjectInstance createMBean(String className, ObjectName name)
-            throws ReflectionException,
-                   InstanceAlreadyExistsException,
-                   MBeanRegistrationException,
-                   MBeanException,
-                   NotCompliantMBeanException {
-        if (mbeanName.equals(name))
-            throw new InstanceAlreadyExistsException(mbeanName.toString());
-        return super.createMBean(className, name);
-    }
-
-    @Override
-    public Object getAttribute(ObjectName name, String attribute)
-            throws MBeanException,
-                   AttributeNotFoundException,
-                   InstanceNotFoundException,
-                   ReflectionException {
-        if (mbeanName.equals(name))
-            return mbeanMBS.getAttribute(name, attribute);
-        else
-            return super.getAttribute(name, attribute);
-    }
-
-    @Override
-    public AttributeList getAttributes(ObjectName name, String[] attributes)
-            throws InstanceNotFoundException, ReflectionException {
-        if (mbeanName.equals(name))
-            return mbeanMBS.getAttributes(name, attributes);
-        else
-            return super.getAttributes(name, attributes);
-    }
-
-    @Override
-    public ClassLoader getClassLoader(ObjectName loaderName)
-            throws InstanceNotFoundException {
-        if (mbeanName.equals(loaderName))
-            return mbeanMBS.getClassLoader(loaderName);
-        else
-            return super.getClassLoader(loaderName);
-    }
-
-    @Override
-    public ClassLoader getClassLoaderFor(ObjectName name)
-            throws InstanceNotFoundException {
-        if (mbeanName.equals(name))
-            return mbeanMBS.getClassLoaderFor(name);
-        else
-            return super.getClassLoaderFor(name);
-    }
-
-    @Override
-    public String[] getDomains() {
-        String[] domains = super.getDomains();
-        if (!visible)
-            return domains;
-        TreeSet<String> domainSet = new TreeSet<String>(Arrays.asList(domains));
-        domainSet.add(mbeanName.getDomain());
-        return domainSet.toArray(new String[domainSet.size()]);
-    }
-
-    @Override
-    public Integer getMBeanCount() {
-        Integer count = super.getMBeanCount();
-        if (visible && !super.isRegistered(mbeanName))
-            count++;
-        return count;
-    }
-
-    @Override
-    public MBeanInfo getMBeanInfo(ObjectName name)
-            throws InstanceNotFoundException,
-                   IntrospectionException,
-                   ReflectionException {
-        if (mbeanName.equals(name))
-            return mbeanMBS.getMBeanInfo(name);
-        else
-            return super.getMBeanInfo(name);
-    }
-
-    @Override
-    public ObjectInstance getObjectInstance(ObjectName name)
-            throws InstanceNotFoundException {
-        if (mbeanName.equals(name))
-            return mbeanMBS.getObjectInstance(name);
-        else
-            return super.getObjectInstance(name);
-    }
-
-    @Override
-    public Object invoke(ObjectName name, String operationName, Object[] params,
-                          String[] signature)
-            throws InstanceNotFoundException,
-                   MBeanException,
-                   ReflectionException {
-        if (mbeanName.equals(name))
-            return mbeanMBS.invoke(name, operationName, params, signature);
-        else
-            return super.invoke(name, operationName, params, signature);
-    }
-
-    @Override
-    public boolean isInstanceOf(ObjectName name, String className)
-            throws InstanceNotFoundException {
-        if (mbeanName.equals(name))
-            return mbeanMBS.isInstanceOf(name, className);
-        else
-            return super.isInstanceOf(name, className);
-    }
-
-    @Override
-    public boolean isRegistered(ObjectName name) {
-        if (mbeanName.equals(name))
-            return true;
-        else
-            return super.isRegistered(name);
-    }
-
-    /**
-     * This is a ugly hack. Although jmx.context//*:* matches jmx.context//:*
-     * queryNames(jmx.context//*:*,null) must not return jmx.context//:*
-     * @param  pattern the pattern to match against. must not be null.
-     * @return true if mbeanName can be included, false if it must not.
-     */
-    private boolean applies(ObjectName pattern) {
-        // we know pattern is not null.
-        if (!visible || !pattern.apply(mbeanName))
-            return false;
-
-        final String dompat = pattern.getDomain();
-        if (!dompat.contains(JMXNamespaces.NAMESPACE_SEPARATOR))
-            return true; // We already checked that patterns apply.
-
-        if (mbeanName.getDomain().endsWith(JMXNamespaces.NAMESPACE_SEPARATOR)) {
-            // only matches if pattern ends with //
-            return dompat.endsWith(JMXNamespaces.NAMESPACE_SEPARATOR);
-        }
-
-        // should not come here, unless mbeanName contains a // in the
-        // middle of its domain, which would be weird.
-        // let query on mbeanMBS proceed and take care of that.
-        //
-        return true;
-    }
-
-    @Override
-    public Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query) {
-        Set<ObjectInstance> names = super.queryMBeans(name, query);
-        if (visible) {
-            if (name == null || applies(name) ) {
-                // Don't assume mbs.queryNames returns a writable set.
-                names = Util.cloneSet(names);
-                names.addAll(mbeanMBS.queryMBeans(name, query));
-            }
-        }
-        return names;
-    }
-
-    @Override
-    public Set<ObjectName> queryNames(ObjectName name, QueryExp query) {
-        Set<ObjectName> names = super.queryNames(name, query);
-        if (visible) {
-            if (name == null || applies(name)) {
-                // Don't assume mbs.queryNames returns a writable set.
-                names = Util.cloneSet(names);
-                names.addAll(mbeanMBS.queryNames(name, query));
-            }
-        }
-        return names;
-    }
-
-
-    @Override
-    public ObjectInstance registerMBean(Object object, ObjectName name)
-            throws InstanceAlreadyExistsException,
-                   MBeanRegistrationException,
-                   NotCompliantMBeanException {
-        if (mbeanName.equals(name))
-            throw new InstanceAlreadyExistsException(mbeanName.toString());
-        else
-            return super.registerMBean(object, name);
-    }
-
-    @Override
-    public void removeNotificationListener(ObjectName name,
-                                            NotificationListener listener,
-                                            NotificationFilter filter,
-                                            Object handback)
-            throws InstanceNotFoundException,
-                   ListenerNotFoundException {
-        if (mbeanName.equals(name))
-            mbeanMBS.removeNotificationListener(name, listener, filter, handback);
-        else
-            super.removeNotificationListener(name, listener, filter, handback);
-    }
-
-    @Override
-    public void removeNotificationListener(ObjectName name,
-                                            NotificationListener listener)
-            throws InstanceNotFoundException, ListenerNotFoundException {
-        if (mbeanName.equals(name))
-            mbeanMBS.removeNotificationListener(name, listener);
-        else
-            super.removeNotificationListener(name, listener);
-    }
-
-    @Override
-    public void removeNotificationListener(ObjectName name, ObjectName listener,
-                                            NotificationFilter filter,
-                                            Object handback)
-            throws InstanceNotFoundException,
-                   ListenerNotFoundException {
-        if (mbeanName.equals(name))
-            mbeanMBS.removeNotificationListener(name, listener, filter, handback);
-        else
-            super.removeNotificationListener(name, listener, filter, handback);
-    }
-
-    @Override
-    public void removeNotificationListener(ObjectName name, ObjectName listener)
-            throws InstanceNotFoundException, ListenerNotFoundException {
-        if (mbeanName.equals(name))
-            mbeanMBS.removeNotificationListener(name, listener);
-        else
-            super.removeNotificationListener(name, listener);
-    }
-
-    @Override
-    public void setAttribute(ObjectName name, Attribute attribute)
-            throws InstanceNotFoundException,
-                   AttributeNotFoundException,
-                   InvalidAttributeValueException,
-                   MBeanException,
-                   ReflectionException {
-        if (mbeanName.equals(name))
-            mbeanMBS.setAttribute(name, attribute);
-        else
-            super.setAttribute(name, attribute);
-    }
-
-    @Override
-    public AttributeList setAttributes(ObjectName name,
-                                        AttributeList attributes)
-            throws InstanceNotFoundException, ReflectionException {
-        if (mbeanName.equals(name))
-            return mbeanMBS.setAttributes(name, attributes);
-        else
-            return super.setAttributes(name, attributes);
-    }
-
-    @Override
-    public void unregisterMBean(ObjectName name)
-            throws InstanceNotFoundException,
-                   MBeanRegistrationException {
-        if (mbeanName.equals(name))
-            mbeanMBS.unregisterMBean(name);
-        else
-            super.unregisterMBean(name);
-    }
-}
--- a/src/share/classes/com/sun/jmx/mbeanserver/ConvertingMethod.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/jmx/mbeanserver/ConvertingMethod.java	Wed Nov 25 22:14:30 2009 -0800
@@ -31,15 +31,13 @@
 
 import javax.management.Descriptor;
 import javax.management.MBeanException;
-import javax.management.openmbean.MXBeanMapping;
-import javax.management.openmbean.MXBeanMappingFactory;
 import javax.management.openmbean.OpenDataException;
 import javax.management.openmbean.OpenType;
 
 final class ConvertingMethod {
-    static ConvertingMethod from(Method m, MXBeanMappingFactory mappingFactory) {
+    static ConvertingMethod from(Method m) {
         try {
-            return new ConvertingMethod(m, mappingFactory);
+            return new ConvertingMethod(m);
         } catch (OpenDataException ode) {
             final String msg = "Method " + m.getDeclaringClass().getName() +
                 "." + m.getName() + " has parameter or return type that " +
@@ -53,7 +51,7 @@
     }
 
     Descriptor getDescriptor() {
-        return Introspector.descriptorForElement(method, false);
+        return Introspector.descriptorForElement(method);
     }
 
     Type getGenericReturnType() {
@@ -206,9 +204,9 @@
         return method.getDeclaringClass() + "." + method.getName();
     }
 
-    private ConvertingMethod(Method m, MXBeanMappingFactory mappingFactory)
-    throws OpenDataException {
+    private ConvertingMethod(Method m) throws OpenDataException {
         this.method = m;
+        MXBeanMappingFactory mappingFactory = MXBeanMappingFactory.DEFAULT;
         returnMapping =
                 mappingFactory.mappingForType(m.getGenericReturnType(), mappingFactory);
         Type[] params = m.getGenericParameterTypes();
--- a/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java	Wed Nov 25 22:14:30 2009 -0800
@@ -28,8 +28,6 @@
 import static com.sun.jmx.mbeanserver.Util.*;
 import static com.sun.jmx.mbeanserver.MXBeanIntrospector.typeName;
 
-import javax.management.openmbean.MXBeanMappingClass;
-
 import static javax.management.openmbean.SimpleType.*;
 
 import com.sun.jmx.remote.util.EnvHelp;
@@ -69,8 +67,6 @@
 import javax.management.openmbean.CompositeDataSupport;
 import javax.management.openmbean.CompositeDataView;
 import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.MXBeanMapping;
-import javax.management.openmbean.MXBeanMappingFactory;
 import javax.management.openmbean.OpenDataException;
 import javax.management.openmbean.OpenType;
 import javax.management.openmbean.SimpleType;
@@ -165,34 +161,29 @@
     private static final class Mappings
         extends WeakHashMap<Type, WeakReference<MXBeanMapping>> {}
 
-    private static final Map<MXBeanMappingFactory, Mappings> factoryMappings =
-            new WeakHashMap<MXBeanMappingFactory, Mappings>();
+    private static final Mappings mappings = new Mappings();
 
-    private static final Map<Type, MXBeanMapping> permanentMappings = newMap();
+    /** Following List simply serves to keep a reference to predefined
+        MXBeanMappings so they don't get garbage collected. */
+    private static final List<MXBeanMapping> permanentMappings = newList();
 
-    private static synchronized MXBeanMapping getMapping(
-            Type type, MXBeanMappingFactory factory) {
-        Mappings mappings = factoryMappings.get(factory);
-        if (mappings == null) {
-            mappings = new Mappings();
-            factoryMappings.put(factory, mappings);
-        }
+    private static synchronized MXBeanMapping getMapping(Type type) {
         WeakReference<MXBeanMapping> wr = mappings.get(type);
         return (wr == null) ? null : wr.get();
     }
 
-    private static synchronized void putMapping(
-            Type type, MXBeanMapping mapping, MXBeanMappingFactory factory) {
-        Mappings mappings = factoryMappings.get(factory);
-        if (mappings == null) {
-            mappings = new Mappings();
-            factoryMappings.put(factory, mappings);
-        }
+    private static synchronized void putMapping(Type type, MXBeanMapping mapping) {
         WeakReference<MXBeanMapping> wr =
             new WeakReference<MXBeanMapping>(mapping);
         mappings.put(type, wr);
     }
 
+    private static synchronized void putPermanentMapping(
+            Type type, MXBeanMapping mapping) {
+        putMapping(type, mapping);
+        permanentMappings.add(mapping);
+    }
+
     static {
         /* Set up the mappings for Java types that map to SimpleType.  */
 
@@ -213,7 +204,7 @@
                 throw new Error(e);
             }
             final MXBeanMapping mapping = new IdentityMapping(c, t);
-            permanentMappings.put(c, mapping);
+            putPermanentMapping(c, mapping);
 
             if (c.getName().startsWith("java.lang.")) {
                 try {
@@ -221,7 +212,7 @@
                     final Class<?> primitiveType = (Class<?>) typeField.get(null);
                     final MXBeanMapping primitiveMapping =
                         new IdentityMapping(primitiveType, t);
-                    permanentMappings.put(primitiveType, primitiveMapping);
+                    putPermanentMapping(primitiveType, primitiveMapping);
                     if (primitiveType != void.class) {
                         final Class<?> primitiveArrayType =
                             Array.newInstance(primitiveType, 0).getClass();
@@ -230,8 +221,8 @@
                         final MXBeanMapping primitiveArrayMapping =
                             new IdentityMapping(primitiveArrayType,
                                                 primitiveArrayOpenType);
-                        permanentMappings.put(primitiveArrayType,
-                                              primitiveArrayMapping);
+                        putPermanentMapping(primitiveArrayType,
+                                            primitiveArrayMapping);
                     }
                 } catch (NoSuchFieldException e) {
                     // OK: must not be a primitive wrapper
@@ -255,7 +246,7 @@
 
         MXBeanMapping mapping;
 
-        mapping = getMapping(objType, null);
+        mapping = getMapping(objType);
         if (mapping != null)
             return mapping;
 
@@ -268,7 +259,7 @@
             inProgress.remove(objType);
         }
 
-        putMapping(objType, mapping, factory);
+        putMapping(objType, mapping);
         return mapping;
     }
 
@@ -278,14 +269,6 @@
         /* It's not yet worth formalizing these tests by having for example
            an array of factory classes, each of which says whether it
            recognizes the Type (Chain of Responsibility pattern).  */
-        MXBeanMapping mapping = permanentMappings.get(objType);
-        if (mapping != null)
-            return mapping;
-        Class<?> erasure = erasure(objType);
-        MXBeanMappingClass mappingClass =
-                erasure.getAnnotation(MXBeanMappingClass.class);
-        if (mappingClass != null)
-            return makeAnnotationMapping(mappingClass, objType, factory);
         if (objType instanceof GenericArrayType) {
             Type componentType =
                 ((GenericArrayType) objType).getGenericComponentType();
@@ -313,51 +296,6 @@
             throw new OpenDataException("Cannot map type: " + objType);
     }
 
-    private static MXBeanMapping
-            makeAnnotationMapping(MXBeanMappingClass mappingClass,
-                                  Type objType,
-                                  MXBeanMappingFactory factory)
-    throws OpenDataException {
-        Class<? extends MXBeanMapping> c = mappingClass.value();
-        Constructor<? extends MXBeanMapping> cons;
-        try {
-            cons = c.getConstructor(Type.class);
-        } catch (NoSuchMethodException e) {
-            final String msg =
-                    "Annotation @" + MXBeanMappingClass.class.getName() +
-                    " must name a class with a public constructor that has a " +
-                    "single " + Type.class.getName() + " argument";
-            OpenDataException ode = new OpenDataException(msg);
-            ode.initCause(e);
-            throw ode;
-        }
-        try {
-            return cons.newInstance(objType);
-        } catch (Exception e) {
-            final String msg =
-                    "Could not construct a " + c.getName() + " for @" +
-                    MXBeanMappingClass.class.getName();
-            OpenDataException ode = new OpenDataException(msg);
-            ode.initCause(e);
-            throw ode;
-        }
-    }
-
-    private static Class<?> erasure(Type t) {
-        if (t instanceof Class<?>)
-            return (Class<?>) t;
-        if (t instanceof ParameterizedType)
-            return erasure(((ParameterizedType) t).getRawType());
-        /* Other cases: GenericArrayType, TypeVariable, WildcardType.
-         * Returning the erasure of GenericArrayType is not necessary because
-         * anyway we will be recursing on the element type, and we'll erase
-         * then.  Returning the erasure of the other two would mean returning
-         * the type bound (e.g. Foo in <T extends Foo> or <? extends Foo>)
-         * and since we don't treat this as Foo elsewhere we shouldn't here.
-         */
-        return Object.class;
-    }
-
     private static <T extends Enum<T>> MXBeanMapping
             makeEnumMapping(Class<?> enumClass, Class<T> fake) {
         return new EnumMapping<T>(Util.<Class<T>>cast(enumClass));
--- a/src/share/classes/com/sun/jmx/mbeanserver/DynamicMBean2.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/jmx/mbeanserver/DynamicMBean2.java	Wed Nov 25 22:14:30 2009 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * 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
@@ -25,7 +25,7 @@
 
 package com.sun.jmx.mbeanserver;
 
-import javax.management.DynamicWrapperMBean;
+import javax.management.DynamicMBean;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
@@ -35,7 +35,17 @@
  *
  * @since 1.6
  */
-public interface DynamicMBean2 extends DynamicWrapperMBean {
+public interface DynamicMBean2 extends DynamicMBean {
+    /**
+     * The resource corresponding to this MBean.  This is the object whose
+     * class name should be reflected by the MBean's
+     * getMBeanInfo().getClassName() for example.  For a "plain"
+     * DynamicMBean it will be "this".  For an MBean that wraps another
+     * object, like javax.management.StandardMBean, it will be the wrapped
+     * object.
+     */
+    public Object getResource();
+
     /**
      * The name of this MBean's class, as used by permission checks.
      * This is typically equal to getResource().getClass().getName().
--- a/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java	Wed Nov 25 21:27:06 2009 +0300
+++ b/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java	Wed Nov 25 22:14:30 2009 -0800
@@ -25,14 +25,9 @@
 
 package com.sun.jmx.mbeanserver;
 
-import com.sun.jmx.remote.util.EnvHelp;
-import java.beans.BeanInfo;
-import java.beans.PropertyDescriptor;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Array;
 import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.Proxy;
@@ -40,39 +35,21 @@
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.logging.Level;
-import javax.management.AttributeNotFoundException;
-import javax.management.Description;
 
 import javax.management.Descriptor;
-import javax.management.DescriptorFields;
 import javax.management.DescriptorKey;
 import javax.management.DynamicMBean;
 import javax.management.ImmutableDescriptor;
-import javax.management.MBean;
 import javax.management.MBeanInfo;
-import javax.management.MXBean;
 import javax.management.NotCompliantMBeanException;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.MXBeanMappingFactory;
 
-import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER;
-import com.sun.jmx.mbeanserver.Util;
 import com.sun.jmx.remote.util.EnvHelp;
 import java.beans.BeanInfo;
 import java.beans.PropertyDescriptor;
 import java.lang.reflect.Array;
 import java.lang.reflect.InvocationTargetException;
-import java.util.LinkedHashSet;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 import javax.management.AttributeNotFoundException;
-import javax.management.JMX;
-import javax.management.ObjectName;
-import javax.management.ObjectNameTemplate;
 import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.MXBeanMappingFactory;
 
 /**
  * This class contains the methods for performing all the tests needed to verify
@@ -82,13 +59,7 @@
  */
 public class Introspector {
 
-    /**
-     * Pattern used to extract Attribute Names from ObjectNameTemplate Annotation
-     * For example, in the following example, the Name attribute value is
-     * retrieved : ":type=MyType, name={Name}"
-     */
-    private static Pattern OBJECT_NAME_PATTERN_TEMPLATE =
-            Pattern.compile("(\\{[^\\}]+\\})|(=\"\\{[^\\}]+\\}\")");
+
      /*
      * ------------------------------------------
      *  PRIVATE CONSTRUCTORS
@@ -164,10 +135,6 @@
 
     public static void checkCompliance(Class<?> mbeanClass)
     throws NotCompliantMBeanException {
-
-        // Check that @Resource is used correctly (if it used).
-        MBeanInjector.validate(mbeanClass);
-
         // Is DynamicMBean?
         //
         if (DynamicMBean.class.isAssignableFrom(mbeanClass))
@@ -190,36 +157,16 @@
         } catch (NotCompliantMBeanException e) {
             mxbeanException = e;
         }
-        // Is @MBean or @MXBean class?
-        // In fact we find @MBean or @MXBean as a hacky variant of
-        // getStandardMBeanInterface or getMXBeanInterface.  If we get here
-        // then nothing worked.
         final String msg =
             "MBean class " + mbeanClass.getName() + " does not implement " +
-            "DynamicMBean; does not follow the Standard MBean conventions (" +
-            mbeanException.toString() + "); does not follow the MXBean conventions (" +
-            mxbeanException.toString() + "); and does not have or inherit the @" +
-            MBean.class.getSimpleName() + " or @" + MXBean.class.getSimpleName() +
-            " annotation";
+            "DynamicMBean, and neither follows the Standard MBean conventions (" +
+            mbeanException.toString() + ") nor the MXBean conventions (" +
+            mxbeanException.toString() + ")";
         throw new NotCompliantMBeanException(msg);
     }
 
-    /**
-     * <p>Make a DynamicMBean out of the existing MBean object.  The object
-     * may already be a DynamicMBean, or it may be a Standard MBean or
-     * MXBean, possibly defined using {@code @MBean} or {@code @MXBean}.</p>
-     * @param mbean the object to convert to a DynamicMBean.
-     * @param <T> a type parameter defined for implementation convenience
-     * (which would have to be removed if this method were part of the public
-     * API).
-     * @return the converted DynamicMBean.
-     * @throws NotCompliantMBeanException if {@code mbean} is not a compliant
-     * MBean object, including the case where it is null.
-     */
     public static <T> DynamicMBean makeDynamicMBean(T mbean)
-    throws NotCompliantMBeanException {
-        if (mbean == null)
-            throw new NotCompliantMBeanException("Null MBean object");
+        throws NotCompliantMBeanException {
         if (mbean instanceof DynamicMBean)
             return (DynamicMBean) mbean;
         final Class<?> mbeanClass = mbean.getClass();
@@ -240,18 +187,8 @@
             // to be an MBean or an MXBean. We will call checkCompliance()
             // to generate the appropriate exception.
         }
-        if (c != null) {
-            MXBeanMappingFactory factory;
-            try {
-                factory = MXBeanMappingFactory.forInterface(c);
-            } catch (IllegalArgumentException e) {
-                NotCompliantMBeanException ncmbe =
-                        new NotCompliantMBeanException(e.getMessage());
-                ncmbe.initCause(e);
-                throw ncmbe;
-            }
-            return new MXBeanSupport(mbean, c, factory);
-        }
+        if (c != null)
+            return new MXBeanSupport(mbean, c);
         checkCompliance(mbeanClass);
         throw new NotCompliantMBeanException("Not compliant"); // not reached
     }
@@ -280,10 +217,9 @@
         return testCompliance(baseClass, null);
     }
 
-    public static void testComplianceMXBeanInterface(Class<?> interfaceClass,
-                                                     MXBeanMappingFactory factory)
+    public static void testComplianceMXBeanInterface(Class<?> interfaceClass)
             throws NotCompliantMBeanException {
-        MXBeanIntrospector.getInstance(factory).getAnalyzer(interfaceClass);
+        MXBeanIntrospector.getInstance().getAnalyzer(interfaceClass);
     }
 
     /**
@@ -352,8 +288,6 @@
      */
     public static <T> Class<? super T> getStandardMBeanInterface(Class<T> baseClass)
     throws NotCompliantMBeanException {
-        if (baseClass.isAnnotationPresent(MBean.class))
-            return baseClass;
         Class<? super T> current = baseClass;
         Class<? super T> mbeanInterface = null;
         while (current != null) {
@@ -384,8 +318,6 @@
      */
     public static <T> Class<? super T> getMXBeanInterface(Class<T> baseClass)
         throws NotCompliantMBeanException {
-        if (hasMXBeanAnnotation(baseClass))
-            return baseClass;
         try {
             return MXBeanSupport.findMXBeanInterface(baseClass);
         } catch (Exception e) {
@@ -393,61 +325,12 @@
         }
     }
 
-    public static <T> Class<? super T> getStandardOrMXBeanInterface(
-            Class<T> baseClass, boolean mxbean)
-    throws NotCompliantMBeanException {
-        if (mxbean)
-            return getMXBeanInterface(baseClass);
-        else
-            return getStandardMBeanInterface(baseClass);
-    }
-
-    public static ObjectName templateToObjectName(Descriptor descriptor,
-            DynamicMBean mbean)
-            throws NotCompliantMBeanException {
-        String template = (String)
-            descriptor.getFieldValue(JMX.OBJECT_NAME_TEMPLATE);
-        if(template == null) return null;
-        try {
-            Matcher m = OBJECT_NAME_PATTERN_TEMPLATE.matcher(template);
-            while (m.find()){
-                String grp = m.group();
-                System.out.println("GROUP " + grp);
-                String attributeName = null;
-                boolean quote = false;
-                if(grp.startsWith("=\"{")) {
-                    attributeName = grp.substring(3, grp.length() - 2);
-                    quote = true;
-                } else
-                    attributeName = grp.substring(1, grp.length() - 1);
-
-                Object attributeValue = mbean.getAttribute(attributeName);
-                String validValue = quote ?
-                    "=" + ObjectName.quote(attributeValue.toString()) :
-                    attributeValue.toString();
-                template = template.replace(grp, validValue);
-            }
-            return new ObjectName(template);
-        }catch(Exception ex) {
-            NotCompliantMBeanException ncex = new
-                    NotCompliantMBeanException(ObjectNameTemplate.class.
-                    getSimpleName() + " annotation value [" + template + "] " +
-                    "is invalid. " + ex);
-            ncex.initCause(ex);
-            throw ncex;
-        }
-    }
-
     /*
      * ------------------------------------------
      *  PRIVATE METHODS
      * ------------------------------------------
      */
 
-    static boolean hasMXBeanAnnotation(Class<?> c) {
-        MXBean m = c.getAnnotation(MXBean.class);
-        return (m != null && m.value());
-    }
 
     /**
      * Try to find the MBean interface corresponding to the class aName
@@ -469,77 +352,11 @@
         return null;
     }
 
-    public static String descriptionForElement(AnnotatedElement elmt) {
-        if (elmt == null)
-            return null;
-        Description d = elmt.getAnnotation(Description.class);
-        if (d == null)
-            return null;
-        return d.value();
-    }
-
-    public static String descriptionForParameter(
-            Annotation[] parameterAnnotations) {
-        for (Annotation a : parameterAnnotations) {
-            if (a instanceof Description)
-                return ((Description) a).value();
-        }
-        return null;
-    }
-
-    public static String nameForParameter(
-            Annotation[] parameterAnnotations) {
-        for (Annotation a : parameterAnnotations) {
-            Class<? extends Annotation> ac = a.annotationType();
-            // You'd really have to go out of your way to have more than
-            // one @Name annotation, so we don't check for that.
-            if (ac.getSimpleName().equals("Name")) {
-                try {
-                    Method value = ac.getMethod("value");
-                    if (value.getReturnType() == String.class &&
-                            value.getParameterTypes().length == 0) {
-                        return (String) value.invoke(a);
-                    }
-                } catch (Exception e) {
-                    MBEANSERVER_LOGGER.log(
-                            Level.WARNING,
-                            "Unexpected exception getting @" + ac.getName(),
-                            e);
-                }
-            }
-        }
-        return null;
-    }
-
-    public static Descriptor descriptorForElement(final AnnotatedElement elmt,
-            boolean isSetter) {
+    public static Descriptor descriptorForElement(final AnnotatedElement elmt) {
         if (elmt == null)
             return ImmutableDescriptor.EMPTY_DESCRIPTOR;
         final Annotation[] annots = elmt.getAnnotations();
-        Descriptor descr = descriptorForAnnotations(annots);
-        String[] exceptions = {};
-        if(elmt instanceof Method)
-            exceptions = getAllExceptions(((Method) elmt).getExceptionTypes());
-        else
-            if(elmt instanceof Constructor<?>)
-                exceptions = getAllExceptions(((Constructor<?>) elmt).
-                        getExceptionTypes());
-
-        if(exceptions.length > 0 ) {
-            String fieldName = isSetter ? JMX.SET_EXCEPTIONS_FIELD :
-                JMX.EXCEPTIONS_FIELD;
-
-            String[] fieldNames = {fieldName};
-            Object[] fieldValues = {exceptions};
-            descr = ImmutableDescriptor.union(descr,
-                    new ImmutableDescriptor(fieldNames, fieldValues));
-        }
-
-        return descr;
-    }
-
-    public static Descriptor descriptorForAnnotation(Annotation annot) {
-        return descriptorForAnnotations(new Annotation[] {annot});
+        return descriptorForAnnotations(annots);
     }
 
     public static Descriptor descriptorForAnnotations(Annotation[] annots) {
@@ -547,9 +364,36 @@
             return ImmutableDescriptor.EMPTY_DESCRIPTOR;
         Map<String, Object> descriptorMap = new HashMap<String, Object>();
         for (Annotation a : annots) {
-            if (a instanceof DescriptorFields)
-                addDescriptorFieldsToMap(descriptorMap, (DescriptorFields) a);
-            addAnnotationFieldsToMap(descriptorMap, a);
+            Class<? extends Annotation> c = a.annotationType();
+            Method[] elements = c.getMethods();
+            for (Method element : elements) {
+                DescriptorKey key = element.getAnnotation(DescriptorKey.class);
+                if (key != null) {
+                    String name = key.value();
+                    Object value;
+                    try {
+                        value = element.invoke(a);
+                    } catch (RuntimeException e) {
+                        // we don't expect this - except for possibly
+                        // security exceptions?
+                        // RuntimeExceptions shouldn't be "