提交 072f4902 编写于 作者: J jgodinez

Merge

...@@ -28,3 +28,6 @@ b4ac413b1f129eeef0acab3f31081c1b7dfe3b27 jdk7-b47 ...@@ -28,3 +28,6 @@ b4ac413b1f129eeef0acab3f31081c1b7dfe3b27 jdk7-b47
fea0898259ae41c73620b1815aa48f036216155c jdk7-b51 fea0898259ae41c73620b1815aa48f036216155c jdk7-b51
bcbeadb4a5d759b29e876ee2c83401e91ff22f60 jdk7-b52 bcbeadb4a5d759b29e876ee2c83401e91ff22f60 jdk7-b52
a2033addca678f9e4c0d92ffa1e389171cc9321d jdk7-b53 a2033addca678f9e4c0d92ffa1e389171cc9321d jdk7-b53
d1c43d1f5676a24ba86221ac7cad5694f3a9afda jdk7-b54
522bb5aa17e0c0cff00b1ed7d1b51bc4db2cfef9 jdk7-b55
7fd3bc37afe36f8f6165ba679db1229716db822a jdk7-b56
...@@ -41,7 +41,7 @@ endif ...@@ -41,7 +41,7 @@ endif
# Omit mirror since it's built with the apt tool. # Omit mirror since it's built with the apt tool.
SUBDIRS = $(SCRIPT_SUBDIR) image security crypto/provider jndi jmx \ SUBDIRS = $(SCRIPT_SUBDIR) image security crypto/provider jndi jmx \
java inputmethods org xml rowset net/httpserver net/ssl demo \ java inputmethods org xml rowset net/httpserver net/ssl demo \
tools jarsigner tracing servicetag tools jarsigner tracing servicetag nio
all build clean clobber:: all build clean clobber::
$(SUBDIRS-loop) $(SUBDIRS-loop)
......
#
# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
#
# Makefile for com.sun.nio packages.
#
BUILDDIR = ../../..
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = sctp
all build clean clobber::
$(SUBDIRS-loop)
clean clobber::
$(RM) -r $(CLASSDESTDIR)/com/sun/nio
#
# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
#
# These are the names of Java classes for which we will make .h files.
#
ifneq ($(PLATFORM), windows)
FILES_export = \
sun/nio/ch/SctpAssocChange.java \
sun/nio/ch/SctpChannelImpl.java \
sun/nio/ch/SctpNet.java \
sun/nio/ch/SctpPeerAddrChange.java \
sun/nio/ch/SctpResultContainer.java \
sun/nio/ch/SctpServerChannelImpl.java \
sun/nio/ch/SctpStdSocketOption.java
endif
#
# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
ifneq ($(PLATFORM),windows)
FILES_c = \
SctpNet.c \
SctpChannelImpl.c \
SctpServerChannelImpl.c
endif
#
# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
FILES_java = \
com/sun/nio/sctp/AbstractNotificationHandler.java \
com/sun/nio/sctp/Association.java \
com/sun/nio/sctp/AssociationChangeNotification.java \
com/sun/nio/sctp/HandlerResult.java \
com/sun/nio/sctp/IllegalReceiveException.java \
com/sun/nio/sctp/IllegalUnbindException.java \
com/sun/nio/sctp/InvalidStreamException.java \
com/sun/nio/sctp/MessageInfo.java \
com/sun/nio/sctp/Notification.java \
com/sun/nio/sctp/NotificationHandler.java \
com/sun/nio/sctp/PeerAddressChangeNotification.java \
com/sun/nio/sctp/SctpChannel.java \
com/sun/nio/sctp/SctpMultiChannel.java \
com/sun/nio/sctp/SctpServerChannel.java \
com/sun/nio/sctp/SctpSocketOption.java \
com/sun/nio/sctp/SctpStandardSocketOption.java \
com/sun/nio/sctp/SendFailedNotification.java \
com/sun/nio/sctp/ShutdownNotification.java \
\
sun/nio/ch/SctpMessageInfoImpl.java \
sun/nio/ch/SctpStdSocketOption.java
ifneq ($(PLATFORM), windows)
FILES_java += \
sun/nio/ch/SctpAssocChange.java \
sun/nio/ch/SctpAssociationImpl.java \
sun/nio/ch/SctpChannelImpl.java \
sun/nio/ch/SctpMultiChannelImpl.java \
sun/nio/ch/SctpNet.java \
sun/nio/ch/SctpNotification.java \
sun/nio/ch/SctpPeerAddrChange.java \
sun/nio/ch/SctpResultContainer.java \
sun/nio/ch/SctpSendFailed.java \
sun/nio/ch/SctpServerChannelImpl.java \
sun/nio/ch/SctpShutdown.java \
sun/nio/ch/SctpSocketDispatcher.java
else
FILES_java += \
sun/nio/ch/SctpChannelImpl.java \
sun/nio/ch/SctpMultiChannelImpl.java \
sun/nio/ch/SctpServerChannelImpl.java
endif
#
# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
#
# Makefile for com.sun.nio.sctp
#
BUILDDIR = ../../../..
PACKAGE = com.sun.nio.sctp
LIBRARY = sctp
PRODUCT = sun
#OTHER_JAVACFLAGS += -Xmaxwarns 1000 -Xlint
include $(BUILDDIR)/common/Defs.gmk
#
# Files to compile
#
include FILES_c.gmk
include FILES_java.gmk
include Exportedfiles.gmk
ifneq ($(PLATFORM), windows)
include $(BUILDDIR)/common/Mapfile-vers.gmk
include $(BUILDDIR)/common/Library.gmk
#
# Find platform-specific C source files
#
vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch
#
# Include nio.h, net_util.h, sun_nio_ch_IOStatus.h, etc
#
OTHER_INCLUDES += \
-I$(SHARE_SRC)/native/sun/nio/ch \
-I$(SHARE_SRC)/native/java/net \
-I$(PLATFORM_SRC)/native/java/net \
-I$(CLASSHDRDIR)/../../../../java/java.nio/nio/CClassHeaders
ifeq ($(PLATFORM), linux)
COMPILER_WARNINGS_FATAL=true
#OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread -ldl
OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -lnio -lnet -lpthread -ldl
endif
ifeq ($(PLATFORM), solaris)
#LIBSCTP = -lsctp
OTHER_LDLIBS += $(LIBSOCKET) -L$(LIBDIR)/$(LIBARCH) -lnet -lnio
endif # PLATFORM
else # windows
include $(BUILDDIR)/common/Classes.gmk
endif # ifneq windows
clean clobber::
$(RM) -r $(CLASSDESTDIR)/com/sun/nio/sctp
$(RM) -r $(CLASSDESTDIR)/sun/nio/ch
#
# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
SUNWprivate_1.1 {
global:
Java_sun_nio_ch_SctpNet_socket0;
Java_sun_nio_ch_SctpNet_bindx;
Java_sun_nio_ch_SctpNet_getLocalAddresses0;
Java_sun_nio_ch_SctpNet_getRemoteAddresses0;
Java_sun_nio_ch_SctpNet_getPrimAddrOption0;
Java_sun_nio_ch_SctpNet_setPrimAddrOption0;
Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0;
Java_sun_nio_ch_SctpNet_getInitMsgOption0;
Java_sun_nio_ch_SctpNet_setInitMsgOption0;
Java_sun_nio_ch_SctpNet_getIntOption0;
Java_sun_nio_ch_SctpNet_setIntOption0;
Java_sun_nio_ch_SctpNet_shutdown0;
Java_sun_nio_ch_SctpChannelImpl_initIDs;
Java_sun_nio_ch_SctpChannelImpl_checkConnect;
Java_sun_nio_ch_SctpChannelImpl_receive0;
Java_sun_nio_ch_SctpChannelImpl_send0;
Java_sun_nio_ch_SctpServerChannelImpl_initIDs;
Java_sun_nio_ch_SctpServerChannelImpl_accept0;
JNI_OnLoad;
local:
*;
};
...@@ -233,6 +233,7 @@ CORE_PKGS = \ ...@@ -233,6 +233,7 @@ CORE_PKGS = \
javax.xml.ws.http \ javax.xml.ws.http \
javax.xml.ws.soap \ javax.xml.ws.soap \
javax.xml.ws.spi \ javax.xml.ws.spi \
javax.xml.ws.wsaddressing \
javax.xml.transform \ javax.xml.transform \
javax.xml.transform.sax \ javax.xml.transform.sax \
javax.xml.transform.dom \ javax.xml.transform.dom \
......
...@@ -86,6 +86,8 @@ TREEAPI_PKGS = com.sun.source.tree \ ...@@ -86,6 +86,8 @@ TREEAPI_PKGS = com.sun.source.tree \
SMARTCARDIO_PKGS = javax.smartcardio SMARTCARDIO_PKGS = javax.smartcardio
SCTPAPI_PKGS = com.sun.nio.sctp
TRACING_PKGS = com.sun.tracing \ TRACING_PKGS = com.sun.tracing \
com.sun.tracing.dtrace com.sun.tracing.dtrace
...@@ -98,4 +100,6 @@ NON_CORE_PKGS = $(DOMAPI_PKGS) \ ...@@ -98,4 +100,6 @@ NON_CORE_PKGS = $(DOMAPI_PKGS) \
$(OLD_JSSE_PKGS) \ $(OLD_JSSE_PKGS) \
$(HTTPSERVER_PKGS) \ $(HTTPSERVER_PKGS) \
$(SMARTCARDIO_PKGS) \ $(SMARTCARDIO_PKGS) \
$(TRACING_PKGS) $(TRACING_PKGS) \
$(SCTPAPI_PKGS)
# #
# Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. # Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -135,6 +135,7 @@ SUNWprivate_1.1 { ...@@ -135,6 +135,7 @@ SUNWprivate_1.1 {
Java_java_lang_ClassLoader_00024NativeLibrary_find; Java_java_lang_ClassLoader_00024NativeLibrary_find;
Java_java_lang_ClassLoader_00024NativeLibrary_load; Java_java_lang_ClassLoader_00024NativeLibrary_load;
Java_java_lang_ClassLoader_00024NativeLibrary_unload; Java_java_lang_ClassLoader_00024NativeLibrary_unload;
Java_java_lang_ClassLoader_getCaller;
Java_java_lang_ClassLoader_registerNatives; Java_java_lang_ClassLoader_registerNatives;
Java_java_lang_Compiler_registerNatives; Java_java_lang_Compiler_registerNatives;
Java_java_lang_Double_longBitsToDouble; Java_java_lang_Double_longBitsToDouble;
......
...@@ -39,6 +39,10 @@ FILES_c = \ ...@@ -39,6 +39,10 @@ FILES_c = \
ResolverConfigurationImpl.c \ ResolverConfigurationImpl.c \
DefaultProxySelector.c DefaultProxySelector.c
ifeq ($(PLATFORM), solaris)
FILES_c += SdpProvider.c
endif
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
FILES_c += linux_close.c FILES_c += linux_close.c
endif endif
......
...@@ -108,11 +108,24 @@ CLASSES.export += java.lang.Integer java.io.FileDescriptor java.net.InetAddressI ...@@ -108,11 +108,24 @@ CLASSES.export += java.lang.Integer java.io.FileDescriptor java.net.InetAddressI
# #
LOCALE_SET_DEFINITION = jre LOCALE_SET_DEFINITION = jre
properties: $(LIBDIR) $(LIBDIR)/net.properties MISC_FILES = $(LIBDIR) $(LIBDIR)/net.properties
$(LIBDIR)/net.properties: $(SHARE_SRC)/lib/net.properties $(LIBDIR)/net.properties: $(SHARE_SRC)/lib/net.properties
@$(RM) $@ @$(RM) $@
$(CP) $< $@ $(CP) $< $@
build: properties #
# SDP configuration template
#
ifeq ($(PLATFORM), solaris)
SDP_PATH = sdp/sdp.conf.template
SDP_CONF = $(LIBDIR)/$(SDP_PATH)
$(SDP_CONF): $(PLATFORM_SRC)/lib/$(SDP_PATH)
@$(RM) $*
$(install-file)
MISC_FILES += $(SDP_CONF)
endif
build: $(MISC_FILES)
...@@ -90,6 +90,7 @@ SUNWprivate_1.1 { ...@@ -90,6 +90,7 @@ SUNWprivate_1.1 {
Java_sun_net_dns_ResolverConfigurationImpl_fallbackDomain0; Java_sun_net_dns_ResolverConfigurationImpl_fallbackDomain0;
Java_sun_net_spi_DefaultProxySelector_init; Java_sun_net_spi_DefaultProxySelector_init;
Java_sun_net_spi_DefaultProxySelector_getSystemProxy; Java_sun_net_spi_DefaultProxySelector_getSystemProxy;
Java_sun_net_spi_SdpProvider_convert;
NET_AllocSockaddr; NET_AllocSockaddr;
NET_SockaddrToInetAddress; NET_SockaddrToInetAddress;
NET_SockaddrEqualsInetAddress; NET_SockaddrEqualsInetAddress;
......
...@@ -189,6 +189,7 @@ SUNWprivate_1.1 { ...@@ -189,6 +189,7 @@ SUNWprivate_1.1 {
Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0; Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0;
Java_sun_nio_fs_UnixNativeDispatcher_getextmntent; Java_sun_nio_fs_UnixNativeDispatcher_getextmntent;
Java_sun_nio_fs_UnixCopyFile_transfer; Java_sun_nio_fs_UnixCopyFile_transfer;
handleSocketError;
local: local:
*; *;
......
...@@ -175,6 +175,7 @@ SUNWprivate_1.1 { ...@@ -175,6 +175,7 @@ SUNWprivate_1.1 {
Java_sun_nio_fs_SolarisWatchService_portDissociate; Java_sun_nio_fs_SolarisWatchService_portDissociate;
Java_sun_nio_fs_SolarisWatchService_portSend; Java_sun_nio_fs_SolarisWatchService_portSend;
Java_sun_nio_fs_SolarisWatchService_portGetn; Java_sun_nio_fs_SolarisWatchService_portGetn;
handleSocketError;
local: local:
*; *;
......
...@@ -92,11 +92,11 @@ FILES_java = \ ...@@ -92,11 +92,11 @@ FILES_java = \
sun/text/normalizer/SymbolTable.java \ sun/text/normalizer/SymbolTable.java \
sun/text/normalizer/Trie.java \ sun/text/normalizer/Trie.java \
sun/text/normalizer/TrieIterator.java \ sun/text/normalizer/TrieIterator.java \
sun/text/normalizer/UBiDiProps.java \
sun/text/normalizer/UCharacter.java \ sun/text/normalizer/UCharacter.java \
sun/text/normalizer/UCharacterIterator.java \ sun/text/normalizer/UCharacterIterator.java \
sun/text/normalizer/UCharacterProperty.java \ sun/text/normalizer/UCharacterProperty.java \
sun/text/normalizer/UCharacterPropertyReader.java \ sun/text/normalizer/UCharacterPropertyReader.java \
sun/text/normalizer/UProperty.java \
sun/text/normalizer/UTF16.java \ sun/text/normalizer/UTF16.java \
sun/text/normalizer/UnicodeMatcher.java \ sun/text/normalizer/UnicodeMatcher.java \
sun/text/normalizer/UnicodeSet.java \ sun/text/normalizer/UnicodeSet.java \
......
...@@ -64,7 +64,8 @@ BIFILES = $(TEXT_CLASSDIR)/CharacterBreakIteratorData \ ...@@ -64,7 +64,8 @@ BIFILES = $(TEXT_CLASSDIR)/CharacterBreakIteratorData \
$(TEXT_CLASSDIR)/SentenceBreakIteratorData $(TEXT_CLASSDIR)/SentenceBreakIteratorData
ICU_FILES = $(TEXT_CLASSDIR)/unorm.icu \ ICU_FILES = $(TEXT_CLASSDIR)/unorm.icu \
$(TEXT_CLASSDIR)/uprops.icu $(TEXT_CLASSDIR)/uprops.icu \
$(TEXT_CLASSDIR)/ubidi.icu
# builder # builder
GENERATEBREAKITERATORDATA_JARFILE = \ GENERATEBREAKITERATORDATA_JARFILE = \
...@@ -89,7 +90,7 @@ $(BIFILES): $(GENERATEBREAKITERATORDATA_JARFILE) \ ...@@ -89,7 +90,7 @@ $(BIFILES): $(GENERATEBREAKITERATORDATA_JARFILE) \
build: $(BIFILES) $(ICU_FILES) build: $(BIFILES) $(ICU_FILES)
# #
# Extra rules to copy unorm.icu and uprops.icu # Extra rules to copy unorm.icu, uprops.icu, and ubidi.icu
# #
$(TEXT_CLASSDIR)/unorm.icu: $(TEXT_SRCDIR)/unorm.icu $(TEXT_CLASSDIR)/unorm.icu: $(TEXT_SRCDIR)/unorm.icu
$(install-file) $(install-file)
...@@ -97,6 +98,9 @@ $(TEXT_CLASSDIR)/unorm.icu: $(TEXT_SRCDIR)/unorm.icu ...@@ -97,6 +98,9 @@ $(TEXT_CLASSDIR)/unorm.icu: $(TEXT_SRCDIR)/unorm.icu
$(TEXT_CLASSDIR)/uprops.icu: $(TEXT_SRCDIR)/uprops.icu $(TEXT_CLASSDIR)/uprops.icu: $(TEXT_SRCDIR)/uprops.icu
$(install-file) $(install-file)
$(TEXT_CLASSDIR)/ubidi.icu: $(TEXT_SRCDIR)/ubidi.icu
$(install-file)
clean clobber:: clean clobber::
$(RM) -r $(TEXT_CLASSES) $(RM) -r $(TEXT_CLASSES)
$(RM) -r $(BIFILES) $(RM) -r $(BIFILES)
......
...@@ -29,7 +29,6 @@ FILES_c = \ ...@@ -29,7 +29,6 @@ FILES_c = \
Deflater.c \ Deflater.c \
Inflater.c \ Inflater.c \
ZipFile.c \ ZipFile.c \
ZipEntry.c \
zadler32.c \ zadler32.c \
zcrc32.c \ zcrc32.c \
deflate.c \ deflate.c \
......
...@@ -50,15 +50,17 @@ SUNWprivate_1.1 { ...@@ -50,15 +50,17 @@ SUNWprivate_1.1 {
Java_java_util_zip_Inflater_initIDs; Java_java_util_zip_Inflater_initIDs;
Java_java_util_zip_Inflater_reset; Java_java_util_zip_Inflater_reset;
Java_java_util_zip_Inflater_setDictionary; Java_java_util_zip_Inflater_setDictionary;
Java_java_util_zip_ZipEntry_initFields;
Java_java_util_zip_ZipEntry_initIDs;
Java_java_util_zip_ZipFile_close; Java_java_util_zip_ZipFile_close;
Java_java_util_zip_ZipFile_freeEntry; Java_java_util_zip_ZipFile_freeEntry;
Java_java_util_zip_ZipFile_getCSize;
Java_java_util_zip_ZipFile_getEntry; Java_java_util_zip_ZipFile_getEntry;
Java_java_util_zip_ZipFile_getMethod; Java_java_util_zip_ZipFile_getEntryBytes;
Java_java_util_zip_ZipFile_getEntryCrc;
Java_java_util_zip_ZipFile_getEntryCSize;
Java_java_util_zip_ZipFile_getEntryFlag;
Java_java_util_zip_ZipFile_getEntryMethod;
Java_java_util_zip_ZipFile_getEntrySize;
Java_java_util_zip_ZipFile_getEntryTime;
Java_java_util_zip_ZipFile_getNextEntry; Java_java_util_zip_ZipFile_getNextEntry;
Java_java_util_zip_ZipFile_getSize;
Java_java_util_zip_ZipFile_getZipMessage; Java_java_util_zip_ZipFile_getZipMessage;
Java_java_util_zip_ZipFile_getTotal; Java_java_util_zip_ZipFile_getTotal;
Java_java_util_zip_ZipFile_initIDs; Java_java_util_zip_ZipFile_initIDs;
......
...@@ -20,12 +20,14 @@ text: .text%Java_java_util_zip_ZipFile_initIDs; ...@@ -20,12 +20,14 @@ text: .text%Java_java_util_zip_ZipFile_initIDs;
text: .text%Java_java_util_zip_ZipFile_open; text: .text%Java_java_util_zip_ZipFile_open;
text: .text%Java_java_util_zip_ZipFile_getTotal; text: .text%Java_java_util_zip_ZipFile_getTotal;
text: .text%Java_java_util_zip_ZipFile_getEntry; text: .text%Java_java_util_zip_ZipFile_getEntry;
text: .text%Java_java_util_zip_ZipEntry_initIDs;
text: .text%Java_java_util_zip_ZipEntry_initFields;
text: .text%Java_java_util_zip_ZipFile_freeEntry; text: .text%Java_java_util_zip_ZipFile_freeEntry;
text: .text%Java_java_util_zip_ZipFile_getCSize; text: .text%Java_java_util_zip_ZipFile_getEntryTime;
text: .text%Java_java_util_zip_ZipFile_getSize; text: .text%Java_java_util_zip_ZipFile_getEntryCrc;
text: .text%Java_java_util_zip_ZipFile_getMethod; text: .text%Java_java_util_zip_ZipFile_getEntryCSize;
text: .text%Java_java_util_zip_ZipFile_getEntrySize;
text: .text%Java_java_util_zip_ZipFile_getEntryFlag;
text: .text%Java_java_util_zip_ZipFile_getEntryMethod;
text: .text%Java_java_util_zip_ZipFile_getEntryBytes;
text: .text%Java_java_util_zip_Inflater_initIDs; text: .text%Java_java_util_zip_Inflater_initIDs;
text: .text%Java_java_util_zip_Inflater_init; text: .text%Java_java_util_zip_Inflater_init;
text: .text%inflateInit2_; text: .text%inflateInit2_;
......
...@@ -19,12 +19,14 @@ text: .text%Java_java_util_zip_ZipFile_initIDs; ...@@ -19,12 +19,14 @@ text: .text%Java_java_util_zip_ZipFile_initIDs;
text: .text%Java_java_util_zip_ZipFile_open; text: .text%Java_java_util_zip_ZipFile_open;
text: .text%Java_java_util_zip_ZipFile_getTotal; text: .text%Java_java_util_zip_ZipFile_getTotal;
text: .text%Java_java_util_zip_ZipFile_getEntry; text: .text%Java_java_util_zip_ZipFile_getEntry;
text: .text%Java_java_util_zip_ZipEntry_initIDs;
text: .text%Java_java_util_zip_ZipEntry_initFields;
text: .text%Java_java_util_zip_ZipFile_freeEntry; text: .text%Java_java_util_zip_ZipFile_freeEntry;
text: .text%Java_java_util_zip_ZipFile_getCSize; text: .text%Java_java_util_zip_ZipFile_getEntryTime;
text: .text%Java_java_util_zip_ZipFile_getSize; text: .text%Java_java_util_zip_ZipFile_getEntryCrc;
text: .text%Java_java_util_zip_ZipFile_getMethod; text: .text%Java_java_util_zip_ZipFile_getEntryCSize;
text: .text%Java_java_util_zip_ZipFile_getEntrySize;
text: .text%Java_java_util_zip_ZipFile_getEntryFlag;
text: .text%Java_java_util_zip_ZipFile_getEntryMethod;
text: .text%Java_java_util_zip_ZipFile_getEntryBytes;
text: .text%Java_java_util_zip_Inflater_initIDs; text: .text%Java_java_util_zip_Inflater_initIDs;
text: .text%Java_java_util_zip_Inflater_init; text: .text%Java_java_util_zip_Inflater_init;
text: .text%inflateInit2_; text: .text%inflateInit2_;
......
...@@ -20,12 +20,14 @@ text: .text%Java_java_util_zip_ZipFile_initIDs; ...@@ -20,12 +20,14 @@ text: .text%Java_java_util_zip_ZipFile_initIDs;
text: .text%Java_java_util_zip_ZipFile_open; text: .text%Java_java_util_zip_ZipFile_open;
text: .text%Java_java_util_zip_ZipFile_getTotal; text: .text%Java_java_util_zip_ZipFile_getTotal;
text: .text%Java_java_util_zip_ZipFile_getEntry; text: .text%Java_java_util_zip_ZipFile_getEntry;
text: .text%Java_java_util_zip_ZipEntry_initIDs;
text: .text%Java_java_util_zip_ZipEntry_initFields;
text: .text%Java_java_util_zip_ZipFile_freeEntry; text: .text%Java_java_util_zip_ZipFile_freeEntry;
text: .text%Java_java_util_zip_ZipFile_getCSize; text: .text%Java_java_util_zip_ZipFile_getEntryTime;
text: .text%Java_java_util_zip_ZipFile_getSize; text: .text%Java_java_util_zip_ZipFile_getEntryCrc;
text: .text%Java_java_util_zip_ZipFile_getMethod; text: .text%Java_java_util_zip_ZipFile_getEntryCSize;
text: .text%Java_java_util_zip_ZipFile_getEntrySize;
text: .text%Java_java_util_zip_ZipFile_getEntryFlag;
text: .text%Java_java_util_zip_ZipFile_getEntryMethod;
text: .text%Java_java_util_zip_ZipFile_getEntryBytes;
text: .text%Java_java_util_zip_Inflater_initIDs; text: .text%Java_java_util_zip_Inflater_initIDs;
text: .text%Java_java_util_zip_Inflater_init; text: .text%Java_java_util_zip_Inflater_init;
text: .text%inflateInit2_; text: .text%inflateInit2_;
......
...@@ -71,6 +71,7 @@ STUBFILES = \ ...@@ -71,6 +71,7 @@ STUBFILES = \
$(STUBDIR)/Ole2.h \ $(STUBDIR)/Ole2.h \
$(STUBDIR)/Zmouse.h \ $(STUBDIR)/Zmouse.h \
$(STUBDIR)/cderr.h \ $(STUBDIR)/cderr.h \
$(STUBDIR)/commctrl.h \
$(STUBDIR)/commdlg.h \ $(STUBDIR)/commdlg.h \
$(STUBDIR)/direct.h \ $(STUBDIR)/direct.h \
$(STUBDIR)/d3dcom.h \ $(STUBDIR)/d3dcom.h \
......
# #
# Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. # Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -103,7 +103,8 @@ FILES_c = \ ...@@ -103,7 +103,8 @@ FILES_c = \
OGLVertexCache.c \ OGLVertexCache.c \
WGLGraphicsConfig.c \ WGLGraphicsConfig.c \
WGLSurfaceData.c \ WGLSurfaceData.c \
AccelGlyphCache.c AccelGlyphCache.c \
rect.c
FILES_cpp = \ FILES_cpp = \
CmdIDList.cpp \ CmdIDList.cpp \
...@@ -198,5 +199,6 @@ FILES_cpp = \ ...@@ -198,5 +199,6 @@ FILES_cpp = \
ShellFolder2.cpp \ ShellFolder2.cpp \
ThemeReader.cpp \ ThemeReader.cpp \
ComCtl32Util.cpp \ ComCtl32Util.cpp \
DllUtil.cpp \
initIDs.cpp \ initIDs.cpp \
MouseInfo.cpp MouseInfo.cpp
# #
# Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. # Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -107,7 +107,8 @@ FILES_export = \ ...@@ -107,7 +107,8 @@ FILES_export = \
sun/java2d/x11/X11Renderer.java \ sun/java2d/x11/X11Renderer.java \
sun/java2d/x11/X11SurfaceData.java \ sun/java2d/x11/X11SurfaceData.java \
com/sun/java/swing/plaf/gtk/GTKEngine.java \ com/sun/java/swing/plaf/gtk/GTKEngine.java \
com/sun/java/swing/plaf/gtk/GTKStyle.java com/sun/java/swing/plaf/gtk/GTKStyle.java \
sun/awt/ExtendedKeyCodes.java
FILES_export2 = \ FILES_export2 = \
......
# #
# Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. # Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -214,6 +214,7 @@ FILES_export3 = \ ...@@ -214,6 +214,7 @@ FILES_export3 = \
sun/awt/windows/WBufferStrategy.java \ sun/awt/windows/WBufferStrategy.java \
sun/awt/windows/WTrayIconPeer.java \ sun/awt/windows/WTrayIconPeer.java \
sun/awt/image/ImagingLib.java \ sun/awt/image/ImagingLib.java \
sun/awt/ExtendedKeyCodes.java \
sun/java2d/pipe/hw/AccelSurface.java \ sun/java2d/pipe/hw/AccelSurface.java \
sun/java2d/pipe/hw/AccelDeviceEventNotifier.java \ sun/java2d/pipe/hw/AccelDeviceEventNotifier.java \
sun/java2d/pipe/hw/ContextCapabilities.java \ sun/java2d/pipe/hw/ContextCapabilities.java \
......
# #
# Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved. # Copyright 1995-2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -219,6 +219,7 @@ vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/cvutils ...@@ -219,6 +219,7 @@ vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/cvutils
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/shell vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/shell
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/medialib vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/medialib
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/debug vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/debug
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/utility
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/loops
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/../java2d/pipe
......
...@@ -6,11 +6,9 @@ runtime, it will probably work with other versions of that compiler. ...@@ -6,11 +6,9 @@ runtime, it will probably work with other versions of that compiler.
Included in this project is a generated file, make.depend, which lists Included in this project is a generated file, make.depend, which lists
all interdependencies of the source files. This file is generated *on all interdependencies of the source files. This file is generated *on
Solaris* with the following commands: Solaris or Linux* with the following command:
% sccs edit make.depend
% gnumake -f Depend.mak % gnumake -f Depend.mak
% sccs delget make.depend
This step only needs to be run when new files are added to the project, This step only needs to be run when new files are added to the project,
or include statements are changed. or include statements are changed.
......
此差异已折叠。
...@@ -291,6 +291,7 @@ SUNWprivate_1.1 { ...@@ -291,6 +291,7 @@ SUNWprivate_1.1 {
Java_sun_awt_X11GraphicsConfig_createBackBuffer; Java_sun_awt_X11GraphicsConfig_createBackBuffer;
Java_sun_awt_X11GraphicsConfig_destroyBackBuffer; Java_sun_awt_X11GraphicsConfig_destroyBackBuffer;
Java_sun_awt_X11GraphicsConfig_swapBuffers; Java_sun_awt_X11GraphicsConfig_swapBuffers;
Java_sun_awt_X11GraphicsConfig_isTranslucencyCapable;
Java_sun_awt_X11GraphicsDevice_isDBESupported; Java_sun_awt_X11GraphicsDevice_isDBESupported;
Java_sun_awt_X11GraphicsDevice_getDisplay; Java_sun_awt_X11GraphicsDevice_getDisplay;
Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals; Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals;
......
...@@ -406,6 +406,7 @@ SUNWprivate_1.1 { ...@@ -406,6 +406,7 @@ SUNWprivate_1.1 {
Java_sun_awt_X11GraphicsConfig_getNumColors; Java_sun_awt_X11GraphicsConfig_getNumColors;
Java_sun_awt_X11GraphicsConfig_getXResolution; Java_sun_awt_X11GraphicsConfig_getXResolution;
Java_sun_awt_X11GraphicsConfig_getYResolution; Java_sun_awt_X11GraphicsConfig_getYResolution;
Java_sun_awt_X11GraphicsConfig_isTranslucencyCapable;
Java_sun_awt_X11GraphicsDevice_isDBESupported; Java_sun_awt_X11GraphicsDevice_isDBESupported;
Java_sun_awt_X11GraphicsDevice_getDisplay; Java_sun_awt_X11GraphicsDevice_getDisplay;
Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals; Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals;
......
...@@ -39,6 +39,7 @@ FILES_java = \ ...@@ -39,6 +39,7 @@ FILES_java = \
sun/net/TransferProtocolClient.java \ sun/net/TransferProtocolClient.java \
sun/net/ConnectionResetException.java \ sun/net/ConnectionResetException.java \
sun/net/NetProperties.java \ sun/net/NetProperties.java \
sun/net/NetHooks.java \
sun/net/util/IPAddressUtil.java \ sun/net/util/IPAddressUtil.java \
sun/net/dns/ResolverConfiguration.java \ sun/net/dns/ResolverConfiguration.java \
sun/net/dns/ResolverConfigurationImpl.java \ sun/net/dns/ResolverConfigurationImpl.java \
...@@ -123,3 +124,7 @@ FILES_java = \ ...@@ -123,3 +124,7 @@ FILES_java = \
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
FILES_java += sun/net/www/protocol/http/NTLMAuthSequence.java FILES_java += sun/net/www/protocol/http/NTLMAuthSequence.java
endif endif
ifeq ($(PLATFORM), solaris)
FILES_java += sun/net/spi/SdpProvider.java
endif
...@@ -78,4 +78,5 @@ FILES_c = \ ...@@ -78,4 +78,5 @@ FILES_c = \
awt_Plugin.c \ awt_Plugin.c \
gtk2_interface.c \ gtk2_interface.c \
swing_GTKEngine.c \ swing_GTKEngine.c \
swing_GTKStyle.c swing_GTKStyle.c \
rect.c
...@@ -79,6 +79,7 @@ vpath %.c $(SHARE_SRC)/native/sun/java2d ...@@ -79,6 +79,7 @@ vpath %.c $(SHARE_SRC)/native/sun/java2d
vpath %.c $(SHARE_SRC)/native/sun/java2d/loops vpath %.c $(SHARE_SRC)/native/sun/java2d/loops
vpath %.c $(SHARE_SRC)/native/sun/java2d/pipe vpath %.c $(SHARE_SRC)/native/sun/java2d/pipe
vpath %.c $(SHARE_SRC)/native/sun/awt/medialib vpath %.c $(SHARE_SRC)/native/sun/awt/medialib
vpath %.c $(SHARE_SRC)/native/sun/awt/utility
vpath %.cpp $(SHARE_SRC)/native/sun/image vpath %.cpp $(SHARE_SRC)/native/sun/image
vpath %.c $(SHARE_SRC)/native/sun/font vpath %.c $(SHARE_SRC)/native/sun/font
vpath %.c $(PLATFORM_SRC)/native/sun/awt/robot_child vpath %.c $(PLATFORM_SRC)/native/sun/awt/robot_child
...@@ -274,6 +275,23 @@ ICONS = \ ...@@ -274,6 +275,23 @@ ICONS = \
$(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \ $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon32.png \
$(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png $(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
ICONPATH=$(PLATFORM_SRC)/classes/sun/awt/X11
ICONS += \
$(ICONPATH)/security-icon-bw16.png \
$(ICONPATH)/security-icon-interim16.png \
$(ICONPATH)/security-icon-yellow16.png \
$(ICONPATH)/security-icon-bw24.png \
$(ICONPATH)/security-icon-interim24.png \
$(ICONPATH)/security-icon-yellow24.png \
$(ICONPATH)/security-icon-bw32.png \
$(ICONPATH)/security-icon-interim32.png \
$(ICONPATH)/security-icon-yellow32.png \
$(ICONPATH)/security-icon-bw48.png \
$(ICONPATH)/security-icon-interim48.png \
$(ICONPATH)/security-icon-yellow48.png
TEMPDIR_CLASSES = $(TEMPDIR)/classes TEMPDIR_CLASSES = $(TEMPDIR)/classes
$(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java $(TEMPDIR_CLASSES)/sun/awt/X11/ToBin.class: ToBin.java
......
# #
# Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. # Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -93,6 +93,9 @@ SUNWprivate_1.1 { ...@@ -93,6 +93,9 @@ SUNWprivate_1.1 {
Java_sun_awt_X11_XlibWrapper_XGetWMHints; Java_sun_awt_X11_XlibWrapper_XGetWMHints;
Java_sun_awt_X11_XlibWrapper_XShapeQueryExtension; Java_sun_awt_X11_XlibWrapper_XShapeQueryExtension;
Java_sun_awt_X11_XlibWrapper_SetRectangularShape; Java_sun_awt_X11_XlibWrapper_SetRectangularShape;
Java_sun_awt_X11_XlibWrapper_SetBitmapShape;
Java_sun_awt_X11_XlibWrapper_XConfigureWindow;
Java_sun_awt_X11_XlibWrapper_SetZOrder;
Java_sun_awt_X11_XToolkit_initIDs; Java_sun_awt_X11_XToolkit_initIDs;
Java_sun_awt_X11_XWindow_getNativeColor; Java_sun_awt_X11_XWindow_getNativeColor;
Java_sun_awt_X11_XWindow_getWMInsets; Java_sun_awt_X11_XWindow_getWMInsets;
...@@ -217,6 +220,7 @@ SUNWprivate_1.1 { ...@@ -217,6 +220,7 @@ SUNWprivate_1.1 {
Java_sun_awt_X11GraphicsConfig_createBackBuffer; Java_sun_awt_X11GraphicsConfig_createBackBuffer;
Java_sun_awt_X11GraphicsConfig_destroyBackBuffer; Java_sun_awt_X11GraphicsConfig_destroyBackBuffer;
Java_sun_awt_X11GraphicsConfig_swapBuffers; Java_sun_awt_X11GraphicsConfig_swapBuffers;
Java_sun_awt_X11GraphicsConfig_isTranslucencyCapable;
Java_java_awt_Insets_initIDs; Java_java_awt_Insets_initIDs;
Java_java_awt_KeyboardFocusManager_initIDs; Java_java_awt_KeyboardFocusManager_initIDs;
Java_java_awt_Font_initIDs; Java_java_awt_Font_initIDs;
...@@ -290,6 +294,16 @@ SUNWprivate_1.1 { ...@@ -290,6 +294,16 @@ SUNWprivate_1.1 {
Java_sun_awt_X11_XlibWrapper_XKeycodeToKeysym; Java_sun_awt_X11_XlibWrapper_XKeycodeToKeysym;
Java_sun_awt_X11_XlibWrapper_XKeysymToKeycode; Java_sun_awt_X11_XlibWrapper_XKeysymToKeycode;
Java_sun_awt_X11_XlibWrapper_XQueryKeymap; Java_sun_awt_X11_XlibWrapper_XQueryKeymap;
Java_sun_awt_X11_XlibWrapper_XkbGetEffectiveGroup;
Java_sun_awt_X11_XlibWrapper_XkbSelectEvents;
Java_sun_awt_X11_XlibWrapper_XkbSelectEventDetails;
Java_sun_awt_X11_XlibWrapper_XkbKeycodeToKeysym;
Java_sun_awt_X11_XlibWrapper_XkbLibraryVersion;
Java_sun_awt_X11_XlibWrapper_XkbQueryExtension;
Java_sun_awt_X11_XlibWrapper_XkbGetMap;
Java_sun_awt_X11_XlibWrapper_XkbGetUpdatedMap;
Java_sun_awt_X11_XlibWrapper_XkbFreeKeyboard;
Java_sun_awt_X11_XlibWrapper_XkbTranslateKeyCode;
Java_sun_awt_X11_XlibWrapper_XGetModifierMapping; Java_sun_awt_X11_XlibWrapper_XGetModifierMapping;
Java_sun_awt_X11_XlibWrapper_XFreeModifiermap; Java_sun_awt_X11_XlibWrapper_XFreeModifiermap;
Java_sun_awt_X11_XlibWrapper_XChangeActivePointerGrab; Java_sun_awt_X11_XlibWrapper_XChangeActivePointerGrab;
......
...@@ -144,6 +144,55 @@ class CharacterData00 extends CharacterData { ...@@ -144,6 +144,55 @@ class CharacterData00 extends CharacterData {
case 0x1FBC : mapChar = 0x1FB3; break; case 0x1FBC : mapChar = 0x1FB3; break;
case 0x1FCC : mapChar = 0x1FC3; break; case 0x1FCC : mapChar = 0x1FC3; break;
case 0x1FFC : mapChar = 0x1FF3; break; case 0x1FFC : mapChar = 0x1FF3; break;
case 0x023A : mapChar = 0x2C65; break;
case 0x023E : mapChar = 0x2C66; break;
case 0x10A0 : mapChar = 0x2D00; break;
case 0x10A1 : mapChar = 0x2D01; break;
case 0x10A2 : mapChar = 0x2D02; break;
case 0x10A3 : mapChar = 0x2D03; break;
case 0x10A4 : mapChar = 0x2D04; break;
case 0x10A5 : mapChar = 0x2D05; break;
case 0x10A6 : mapChar = 0x2D06; break;
case 0x10A7 : mapChar = 0x2D07; break;
case 0x10A8 : mapChar = 0x2D08; break;
case 0x10A9 : mapChar = 0x2D09; break;
case 0x10AA : mapChar = 0x2D0A; break;
case 0x10AB : mapChar = 0x2D0B; break;
case 0x10AC : mapChar = 0x2D0C; break;
case 0x10AD : mapChar = 0x2D0D; break;
case 0x10AE : mapChar = 0x2D0E; break;
case 0x10AF : mapChar = 0x2D0F; break;
case 0x10B0 : mapChar = 0x2D10; break;
case 0x10B1 : mapChar = 0x2D11; break;
case 0x10B2 : mapChar = 0x2D12; break;
case 0x10B3 : mapChar = 0x2D13; break;
case 0x10B4 : mapChar = 0x2D14; break;
case 0x10B5 : mapChar = 0x2D15; break;
case 0x10B6 : mapChar = 0x2D16; break;
case 0x10B7 : mapChar = 0x2D17; break;
case 0x10B8 : mapChar = 0x2D18; break;
case 0x10B9 : mapChar = 0x2D19; break;
case 0x10BA : mapChar = 0x2D1A; break;
case 0x10BB : mapChar = 0x2D1B; break;
case 0x10BC : mapChar = 0x2D1C; break;
case 0x10BD : mapChar = 0x2D1D; break;
case 0x10BE : mapChar = 0x2D1E; break;
case 0x10BF : mapChar = 0x2D1F; break;
case 0x10C0 : mapChar = 0x2D20; break;
case 0x10C1 : mapChar = 0x2D21; break;
case 0x10C2 : mapChar = 0x2D22; break;
case 0x10C3 : mapChar = 0x2D23; break;
case 0x10C4 : mapChar = 0x2D24; break;
case 0x10C5 : mapChar = 0x2D25; break;
case 0x1E9E : mapChar = 0x00DF; break;
case 0x2C62 : mapChar = 0x026B; break;
case 0x2C63 : mapChar = 0x1D7D; break;
case 0x2C64 : mapChar = 0x027D; break;
case 0x2C6D : mapChar = 0x0251; break;
case 0x2C6E : mapChar = 0x0271; break;
case 0x2C6F : mapChar = 0x0250; break;
case 0xA77D : mapChar = 0x1D79; break;
// default mapChar is already set, so no // default mapChar is already set, so no
// need to redo it here. // need to redo it here.
// default : mapChar = ch; // default : mapChar = ch;
...@@ -196,6 +245,54 @@ class CharacterData00 extends CharacterData { ...@@ -196,6 +245,54 @@ class CharacterData00 extends CharacterData {
case 0x1FB3 : mapChar = 0x1FBC; break; case 0x1FB3 : mapChar = 0x1FBC; break;
case 0x1FC3 : mapChar = 0x1FCC; break; case 0x1FC3 : mapChar = 0x1FCC; break;
case 0x1FF3 : mapChar = 0x1FFC; break; case 0x1FF3 : mapChar = 0x1FFC; break;
case 0x0250 : mapChar = 0x2C6F; break;
case 0x0251 : mapChar = 0x2C6D; break;
case 0x026B : mapChar = 0x2C62; break;
case 0x0271 : mapChar = 0x2C6E; break;
case 0x027D : mapChar = 0x2C64; break;
case 0x1D79 : mapChar = 0xA77D; break;
case 0x1D7D : mapChar = 0x2C63; break;
case 0x2C65 : mapChar = 0x023A; break;
case 0x2C66 : mapChar = 0x023E; break;
case 0x2D00 : mapChar = 0x10A0; break;
case 0x2D01 : mapChar = 0x10A1; break;
case 0x2D02 : mapChar = 0x10A2; break;
case 0x2D03 : mapChar = 0x10A3; break;
case 0x2D04 : mapChar = 0x10A4; break;
case 0x2D05 : mapChar = 0x10A5; break;
case 0x2D06 : mapChar = 0x10A6; break;
case 0x2D07 : mapChar = 0x10A7; break;
case 0x2D08 : mapChar = 0x10A8; break;
case 0x2D09 : mapChar = 0x10A9; break;
case 0x2D0A : mapChar = 0x10AA; break;
case 0x2D0B : mapChar = 0x10AB; break;
case 0x2D0C : mapChar = 0x10AC; break;
case 0x2D0D : mapChar = 0x10AD; break;
case 0x2D0E : mapChar = 0x10AE; break;
case 0x2D0F : mapChar = 0x10AF; break;
case 0x2D10 : mapChar = 0x10B0; break;
case 0x2D11 : mapChar = 0x10B1; break;
case 0x2D12 : mapChar = 0x10B2; break;
case 0x2D13 : mapChar = 0x10B3; break;
case 0x2D14 : mapChar = 0x10B4; break;
case 0x2D15 : mapChar = 0x10B5; break;
case 0x2D16 : mapChar = 0x10B6; break;
case 0x2D17 : mapChar = 0x10B7; break;
case 0x2D18 : mapChar = 0x10B8; break;
case 0x2D19 : mapChar = 0x10B9; break;
case 0x2D1A : mapChar = 0x10BA; break;
case 0x2D1B : mapChar = 0x10BB; break;
case 0x2D1C : mapChar = 0x10BC; break;
case 0x2D1D : mapChar = 0x10BD; break;
case 0x2D1E : mapChar = 0x10BE; break;
case 0x2D1F : mapChar = 0x10BF; break;
case 0x2D20 : mapChar = 0x10C0; break;
case 0x2D21 : mapChar = 0x10C1; break;
case 0x2D22 : mapChar = 0x10C2; break;
case 0x2D23 : mapChar = 0x10C3; break;
case 0x2D24 : mapChar = 0x10C4; break;
case 0x2D25 : mapChar = 0x10C5; break;
// ch must have a 1:M case mapping, but we // ch must have a 1:M case mapping, but we
// can't handle it here. Return ch. // can't handle it here. Return ch.
// since mapChar is already set, no need // since mapChar is already set, no need
...@@ -315,6 +412,12 @@ class CharacterData00 extends CharacterData { ...@@ -315,6 +412,12 @@ class CharacterData00 extends CharacterData {
case 0x32BE: retval = 49; break; // CIRCLED NUMBER FORTY NINE case 0x32BE: retval = 49; break; // CIRCLED NUMBER FORTY NINE
case 0x32BF: retval = 50; break; // CIRCLED NUMBER FIFTY case 0x32BF: retval = 50; break; // CIRCLED NUMBER FIFTY
case 0x0D71: retval = 100; break; // MALAYALAM NUMBER ONE HUNDRED
case 0x0D72: retval = 1000; break; // MALAYALAM NUMBER ONE THOUSAND
case 0x2186: retval = 50; break; // ROMAN NUMERAL FIFTY EARLY FORM
case 0x2187: retval = 50000; break; // ROMAN NUMERAL FIFTY THOUSAND
case 0x2188: retval = 100000; break; // ROMAN NUMERAL ONE HUNDRED THOUSAND
default: retval = -2; break; default: retval = -2; break;
} }
break; break;
...@@ -383,6 +486,54 @@ class CharacterData00 extends CharacterData { ...@@ -383,6 +486,54 @@ class CharacterData00 extends CharacterData {
case 0x00B5 : mapChar = 0x039C; break; case 0x00B5 : mapChar = 0x039C; break;
case 0x017F : mapChar = 0x0053; break; case 0x017F : mapChar = 0x0053; break;
case 0x1FBE : mapChar = 0x0399; break; case 0x1FBE : mapChar = 0x0399; break;
case 0x0250 : mapChar = 0x2C6F; break;
case 0x0251 : mapChar = 0x2C6D; break;
case 0x026B : mapChar = 0x2C62; break;
case 0x0271 : mapChar = 0x2C6E; break;
case 0x027D : mapChar = 0x2C64; break;
case 0x1D79 : mapChar = 0xA77D; break;
case 0x1D7D : mapChar = 0x2C63; break;
case 0x2C65 : mapChar = 0x023A; break;
case 0x2C66 : mapChar = 0x023E; break;
case 0x2D00 : mapChar = 0x10A0; break;
case 0x2D01 : mapChar = 0x10A1; break;
case 0x2D02 : mapChar = 0x10A2; break;
case 0x2D03 : mapChar = 0x10A3; break;
case 0x2D04 : mapChar = 0x10A4; break;
case 0x2D05 : mapChar = 0x10A5; break;
case 0x2D06 : mapChar = 0x10A6; break;
case 0x2D07 : mapChar = 0x10A7; break;
case 0x2D08 : mapChar = 0x10A8; break;
case 0x2D09 : mapChar = 0x10A9; break;
case 0x2D0A : mapChar = 0x10AA; break;
case 0x2D0B : mapChar = 0x10AB; break;
case 0x2D0C : mapChar = 0x10AC; break;
case 0x2D0D : mapChar = 0x10AD; break;
case 0x2D0E : mapChar = 0x10AE; break;
case 0x2D0F : mapChar = 0x10AF; break;
case 0x2D10 : mapChar = 0x10B0; break;
case 0x2D11 : mapChar = 0x10B1; break;
case 0x2D12 : mapChar = 0x10B2; break;
case 0x2D13 : mapChar = 0x10B3; break;
case 0x2D14 : mapChar = 0x10B4; break;
case 0x2D15 : mapChar = 0x10B5; break;
case 0x2D16 : mapChar = 0x10B6; break;
case 0x2D17 : mapChar = 0x10B7; break;
case 0x2D18 : mapChar = 0x10B8; break;
case 0x2D19 : mapChar = 0x10B9; break;
case 0x2D1A : mapChar = 0x10BA; break;
case 0x2D1B : mapChar = 0x10BB; break;
case 0x2D1C : mapChar = 0x10BC; break;
case 0x2D1D : mapChar = 0x10BD; break;
case 0x2D1E : mapChar = 0x10BE; break;
case 0x2D1F : mapChar = 0x10BF; break;
case 0x2D20 : mapChar = 0x10C0; break;
case 0x2D21 : mapChar = 0x10C1; break;
case 0x2D22 : mapChar = 0x10C2; break;
case 0x2D23 : mapChar = 0x10C3; break;
case 0x2D24 : mapChar = 0x10C4; break;
case 0x2D25 : mapChar = 0x10C5; break;
default : mapChar = Character.ERROR; break; default : mapChar = Character.ERROR; break;
} }
} }
......
...@@ -218,6 +218,48 @@ class CharacterData01 extends CharacterData { ...@@ -218,6 +218,48 @@ class CharacterData01 extends CharacterData {
case 0x10132: retval = 80000; break; // AEGEAN NUMBER EIGHTY THOUSAND case 0x10132: retval = 80000; break; // AEGEAN NUMBER EIGHTY THOUSAND
case 0x10133: retval = 90000; break; // AEGEAN NUMBER NINETY THOUSAND case 0x10133: retval = 90000; break; // AEGEAN NUMBER NINETY THOUSAND
case 0x10323: retval = 50; break; // OLD ITALIC NUMERAL FIFTY case 0x10323: retval = 50; break; // OLD ITALIC NUMERAL FIFTY
case 0x010144: retval = 50; break; // ACROPHONIC ATTIC FIFTY
case 0x010145: retval = 500; break; // ACROPHONIC ATTIC FIVE HUNDRED
case 0x010146: retval = 5000; break; // ACROPHONIC ATTIC FIVE THOUSAND
case 0x010147: retval = 50000; break; // ACROPHONIC ATTIC FIFTY THOUSAND
case 0x01014A: retval = 50; break; // ACROPHONIC ATTIC FIFTY TALENTS
case 0x01014B: retval = 100; break; // ACROPHONIC ATTIC ONE HUNDRED TALENTS
case 0x01014C: retval = 500; break; // ACROPHONIC ATTIC FIVE HUNDRED TALENTS
case 0x01014D: retval = 1000; break; // ACROPHONIC ATTIC ONE THOUSAND TALENTS
case 0x01014E: retval = 5000; break; // ACROPHONIC ATTIC FIVE THOUSAND TALENTS
case 0x010151: retval = 50; break; // ACROPHONIC ATTIC FIFTY STATERS
case 0x010152: retval = 100; break; // ACROPHONIC ATTIC ONE HUNDRED STATERS
case 0x010153: retval = 500; break; // ACROPHONIC ATTIC FIVE HUNDRED STATERS
case 0x010154: retval = 1000; break; // ACROPHONIC ATTIC ONE THOUSAND STATERS
case 0x010155: retval = 10000; break; // ACROPHONIC ATTIC TEN THOUSAND STATERS
case 0x010156: retval = 50000; break; // ACROPHONIC ATTIC FIFTY THOUSAND STATERS
case 0x010166: retval = 50; break; // ACROPHONIC TROEZENIAN FIFTY
case 0x010167: retval = 50; break; // ACROPHONIC TROEZENIAN FIFTY ALTERNATE FORM
case 0x010168: retval = 50; break; // ACROPHONIC HERMIONIAN FIFTY
case 0x010169: retval = 50; break; // ACROPHONIC THESPIAN FIFTY
case 0x01016A: retval = 100; break; // ACROPHONIC THESPIAN ONE HUNDRED
case 0x01016B: retval = 300; break; // ACROPHONIC THESPIAN THREE HUNDRED
case 0x01016C: retval = 500; break; // ACROPHONIC EPIDAUREAN FIVE HUNDRED
case 0x01016D: retval = 500; break; // ACROPHONIC TROEZENIAN FIVE HUNDRED
case 0x01016E: retval = 500; break; // ACROPHONIC THESPIAN FIVE HUNDRED
case 0x01016F: retval = 500; break; // ACROPHONIC CARYSTIAN FIVE HUNDRED
case 0x010170: retval = 500; break; // ACROPHONIC NAXIAN FIVE HUNDRED
case 0x010171: retval = 1000; break; // ACROPHONIC THESPIAN ONE THOUSAND
case 0x010172: retval = 5000; break; // ACROPHONIC THESPIAN FIVE THOUSAND
case 0x010174: retval = 50; break; // ACROPHONIC STRATIAN FIFTY MNAS
case 0x010341: retval = 90; break; // GOTHIC LETTER NINETY
case 0x01034A: retval = 900; break; // GOTHIC LETTER NINE HUNDRED
case 0x0103D5: retval = 100; break; // OLD PERSIAN NUMBER HUNDRED
case 0x010919: retval = 100; break; // PHOENICIAN NUMBER ONE HUNDRED
case 0x010A46: retval = 100; break; // KHAROSHTHI NUMBER ONE HUNDRED
case 0x010A47: retval = 1000; break; // KHAROSHTHI NUMBER ONE THOUSAND
case 0x01D36C: retval = 40; break; // COUNTING ROD TENS DIGIT FOUR
case 0x01D36D: retval = 50; break; // COUNTING ROD TENS DIGIT FIVE
case 0x01D36E: retval = 60; break; // COUNTING ROD TENS DIGIT SIX
case 0x01D36F: retval = 70; break; // COUNTING ROD TENS DIGIT SEVEN
case 0x01D370: retval = 80; break; // COUNTING ROD TENS DIGIT EIGHT
case 0x01D371: retval = 90; break; // COUNTING ROD TENS DIGIT NINE
default: retval = -2; break; default: retval = -2; break;
} }
......
# SpecialCasing-4.0.0.txt # SpecialCasing-5.1.0.txt
# Date: 2003-03-14, 20:22:04 GMT [MD] # Date: 2008-03-03, 21:58:10 GMT [MD]
#
# Unicode Character Database
# Copyright (c) 1991-2008 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see UCD.html
# #
# Special Casing Properties # Special Casing Properties
# #
# This file is a supplement to the UnicodeData file. # This file is a supplement to the UnicodeData file.
# It contains additional information about the casing of Unicode characters. # It contains additional information about the casing of Unicode characters.
# (For compatibility, the UnicodeData.txt file only contains case mappings for # (For compatibility, the UnicodeData.txt file only contains case mappings for
# characters where they are 1-1, and does not have locale-specific mappings.) # characters where they are 1-1, and independent of context and language.
# For more information, see the discussion of Case Mappings in the Unicode Standard. # For more information, see the discussion of Case Mappings in the Unicode Standard.
# #
# All code points not listed in this file that do not have a simple case mappings # All code points not listed in this file that do not have a simple case mappings
...@@ -18,31 +23,31 @@ ...@@ -18,31 +23,31 @@
# #
# <code>; <lower> ; <title> ; <upper> ; (<condition_list> ;)? # <comment> # <code>; <lower> ; <title> ; <upper> ; (<condition_list> ;)? # <comment>
# #
# <code>, <lower>, <title>, and <upper> provide character values in hex. If there is more than # <code>, <lower>, <title>, and <upper> provide character values in hex. If there is more
# one character, they are separated by spaces. Other than as used to separate elements, # than one character, they are separated by spaces. Other than as used to separate
# spaces are to be ignored. # elements, spaces are to be ignored.
# #
# The <condition_list> is optional. Where present, it consists of one or more locales or contexts, # The <condition_list> is optional. Where present, it consists of one or more language IDs
# separated by spaces. In these conditions: # or contexts, separated by spaces. In these conditions:
# - A condition list overrides the normal behavior if all of the listed conditions are true. # - A condition list overrides the normal behavior if all of the listed conditions are true.
# - The context is always the context of the characters in the original string, # - The context is always the context of the characters in the original string,
# NOT in the resulting string. # NOT in the resulting string.
# - Case distinctions in the condition list are not significant. # - Case distinctions in the condition list are not significant.
# - Conditions preceded by "Not_" represent the negation of the condition. # - Conditions preceded by "Not_" represent the negation of the condition.
# The condition list is not represented in the UCD as a formal property.
# #
# A locale is defined as: # A language ID is defined by BCP 47, with '-' and '_' treated equivalently.
# <locale> := <ISO_639_code> ( "_" <ISO_3166_code> ( "_" <variant> )? )?
# <ISO_3166_code> := 2-letter ISO country code,
# <ISO_639_code> := 2-letter ISO language code
# #
# A context is one of the following, as defined in the Unicode Standard: # A context for a character C is defined by Section 3.13 Default Case
# Final_Sigma, After_Soft_Dotted, More_Above, Before_Dot, Not_Before_Dot, After_I # Operations, of The Unicode Standard, Version 5.0.
# (This is identical to the context defined by Unicode 4.1.0,
# as specified in http://www.unicode.org/versions/Unicode4.1.0/)
# #
# Parsers of this file must be prepared to deal with future additions to this format: # Parsers of this file must be prepared to deal with future additions to this format:
# * Additional contexts # * Additional contexts
# * Additional fields # * Additional fields
# ================================================================================ # ================================================================================
# @missing 0000..10FFFF; <slc>; <stc>; <suc>
# ================================================================================ # ================================================================================
# Unconditional mappings # Unconditional mappings
# ================================================================================ # ================================================================================
...@@ -170,7 +175,7 @@ FB17; FB17; 0544 056D; 0544 053D; # ARMENIAN SMALL LIGATURE MEN XEH ...@@ -170,7 +175,7 @@ FB17; FB17; 0544 056D; 0544 053D; # ARMENIAN SMALL LIGATURE MEN XEH
1FF3; 1FF3; 1FFC; 03A9 0399; # GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI 1FF3; 1FF3; 1FFC; 03A9 0399; # GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI
1FFC; 1FF3; 1FFC; 03A9 0399; # GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI 1FFC; 1FF3; 1FFC; 03A9 0399; # GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
# Some characters with YPOGEGRAMMENI are also have no corresponding titlecases # Some characters with YPOGEGRAMMENI also have no corresponding titlecases
1FB2; 1FB2; 1FBA 0345; 1FBA 0399; # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI 1FB2; 1FB2; 1FBA 0345; 1FBA 0399; # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
1FB4; 1FB4; 0386 0345; 0386 0399; # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI 1FB4; 1FB4; 0386 0345; 0386 0399; # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
...@@ -184,7 +189,14 @@ FB17; FB17; 0544 056D; 0544 053D; # ARMENIAN SMALL LIGATURE MEN XEH ...@@ -184,7 +189,14 @@ FB17; FB17; 0544 056D; 0544 053D; # ARMENIAN SMALL LIGATURE MEN XEH
1FF7; 1FF7; 03A9 0342 0345; 03A9 0342 0399; # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI 1FF7; 1FF7; 03A9 0342 0345; 03A9 0342 0399; # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
# ================================================================================ # ================================================================================
# Conditional mappings # Conditional Mappings
# The remainder of this file provides conditional casing data used to produce
# full case mappings.
# ================================================================================
# Language-Insensitive Mappings
# These are characters whose full case mappings do not depend on language, but do
# depend on context (which characters come before or after). For more information
# see the header of this file and the Unicode Standard.
# ================================================================================ # ================================================================================
# Special case for final form of sigma # Special case for final form of sigma
...@@ -203,7 +215,10 @@ FB17; FB17; 0544 056D; 0544 053D; # ARMENIAN SMALL LIGATURE MEN XEH ...@@ -203,7 +215,10 @@ FB17; FB17; 0544 056D; 0544 053D; # ARMENIAN SMALL LIGATURE MEN XEH
# 03C2; 03C3; 03A3; 03A3; Not_Final_Sigma; # GREEK SMALL LETTER FINAL SIGMA # 03C2; 03C3; 03A3; 03A3; Not_Final_Sigma; # GREEK SMALL LETTER FINAL SIGMA
# ================================================================================ # ================================================================================
# Locale-sensitive mappings # Language-Sensitive Mappings
# These are characters whose full case mappings depend on language and perhaps also
# context (which characters come before or after). For more information
# see the header of this file and the Unicode Standard.
# ================================================================================ # ================================================================================
# Lithuanian # Lithuanian
...@@ -254,3 +269,6 @@ FB17; FB17; 0544 056D; 0544 053D; # ARMENIAN SMALL LIGATURE MEN XEH ...@@ -254,3 +269,6 @@ FB17; FB17; 0544 056D; 0544 053D; # ARMENIAN SMALL LIGATURE MEN XEH
# Note: the following case is already in the UnicodeData file. # Note: the following case is already in the UnicodeData file.
# 0131; 0131; 0049; 0049; tr; # LATIN SMALL LETTER DOTLESS I # 0131; 0131; 0049; 0049; tr; # LATIN SMALL LETTER DOTLESS I
# EOF
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
#define JAR_ERROR2 "Error: Unable to access jarfile %s" #define JAR_ERROR2 "Error: Unable to access jarfile %s"
#define JAR_ERROR3 "Error: Invalid or corrupt jarfile %s" #define JAR_ERROR3 "Error: Invalid or corrupt jarfile %s"
#define CLS_ERROR1 "Error: Could not find the main class %s.\n" JNI_ERROR
#define CLS_ERROR2 "Error: Failed to load Main Class: %s\n%s"
#define CLS_ERROR3 "Error: No main method found in specified class.\n" GEN_ERROR
#define CLS_ERROR4 "Error: Main method not public\n" GEN_ERROR
#define CLS_ERROR5 "Error: main-class: attribute exceeds system limits of %d bytes\n" GEN_ERROR
#define CFG_WARN1 "Warning: %s VM not supported; %s VM will be used" #define CFG_WARN1 "Warning: %s VM not supported; %s VM will be used"
#define CFG_WARN2 "Warning: No leading - on line %d of `%s'" #define CFG_WARN2 "Warning: No leading - on line %d of `%s'"
#define CFG_WARN3 "Warning: Missing VM type on line %d of `%s'" #define CFG_WARN3 "Warning: Missing VM type on line %d of `%s'"
......
...@@ -915,8 +915,14 @@ SelectVersion(int argc, char **argv, char **main_class) ...@@ -915,8 +915,14 @@ SelectVersion(int argc, char **argv, char **main_class)
* to avoid locating, expanding and parsing the manifest extra * to avoid locating, expanding and parsing the manifest extra
* times. * times.
*/ */
if (info.main_class != NULL) if (info.main_class != NULL) {
if (JLI_StrLen(info.main_class) <= MAXNAMELEN) {
(void)JLI_StrCat(env_entry, info.main_class); (void)JLI_StrCat(env_entry, info.main_class);
} else {
JLI_ReportErrorMessage(CLS_ERROR5, MAXNAMELEN);
exit(1);
}
}
(void)putenv(env_entry); (void)putenv(env_entry);
ExecJRE(jre, new_argv); ExecJRE(jre, new_argv);
JLI_FreeManifest(); JLI_FreeManifest();
......
/* /*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -26,17 +26,37 @@ ...@@ -26,17 +26,37 @@
package com.sun.awt; package com.sun.awt;
import java.awt.*; import java.awt.*;
import sun.awt.AWTAccessor;
import sun.awt.AWTAccessor;
import sun.awt.SunToolkit;
/** /**
* A collection of utility methods for AWT. * A collection of utility methods for AWT.
* *
* The functionality provided by the static methods of the class includes: * The functionality provided by the static methods of the class includes:
* <ul> * <ul>
* <li>Setting shapes on top-level windows
* <li>Setting a constant alpha value for each pixel of a top-level window
* <li>Making a window non-opaque, after that it paints only explicitly
* painted pixels on the screen, with arbitrary alpha values for every pixel.
* <li>Setting a 'mixing-cutout' shape for a component. * <li>Setting a 'mixing-cutout' shape for a component.
* </ul> * </ul>
* <p> * <p>
* A "top-level window" is an instance of the {@code Window} class (or its
* descendant, such as {@code JFrame}).
* <p>
* Some of the mentioned features may not be supported by the native platform.
* To determine whether a particular feature is supported, the user must use
* the {@code isTranslucencySupported()} method of the class passing a desired
* translucency kind (a member of the {@code Translucency} enum) as an
* argument.
* <p>
* The per-pixel alpha feature also requires the user to create her/his
* windows using a translucency-capable graphics configuration.
* The {@code isTranslucencyCapable()} method must
* be used to verify whether any given GraphicsConfiguration supports
* the trasnlcency effects.
* <p>
* <b>WARNING</b>: This class is an implementation detail and only meant * <b>WARNING</b>: This class is an implementation detail and only meant
* for limited use outside of the core platform. This API may change * for limited use outside of the core platform. This API may change
* drastically between update release, and it may even be * drastically between update release, and it may even be
...@@ -50,6 +70,344 @@ public final class AWTUtilities { ...@@ -50,6 +70,344 @@ public final class AWTUtilities {
private AWTUtilities() { private AWTUtilities() {
} }
/** Kinds of translucency supported by the underlying system.
* @see #isTranslucencySupported
*/
public static enum Translucency {
/**
* Represents support in the underlying system for windows each pixel
* of which is guaranteed to be either completely opaque, with
* an alpha value of 1.0, or completely transparent, with an alpha
* value of 0.0.
*/
PERPIXEL_TRANSPARENT,
/**
* Represents support in the underlying system for windows all of
* the pixels of which have the same alpha value between or including
* 0.0 and 1.0.
*/
TRANSLUCENT,
/**
* Represents support in the underlying system for windows that
* contain or might contain pixels with arbitrary alpha values
* between and including 0.0 and 1.0.
*/
PERPIXEL_TRANSLUCENT;
}
/**
* Returns whether the given level of translucency is supported by
* the underlying system.
*
* Note that this method may sometimes return the value
* indicating that the particular level is supported, but
* the native windowing system may still not support the
* given level of translucency (due to the bugs in
* the windowing system).
*
* @param translucencyKind a kind of translucency support
* (either PERPIXEL_TRANSPARENT,
* TRANSLUCENT, or PERPIXEL_TRANSLUCENT)
* @return whether the given translucency kind is supported
*/
public static boolean isTranslucencySupported(Translucency translucencyKind) {
switch (translucencyKind) {
case PERPIXEL_TRANSPARENT:
return isWindowShapingSupported();
case TRANSLUCENT:
return isWindowOpacitySupported();
case PERPIXEL_TRANSLUCENT:
return isWindowTranslucencySupported();
}
return false;
}
/**
* Returns whether the windowing system supports changing the opacity
* value of top-level windows.
* Note that this method may sometimes return true, but the native
* windowing system may still not support the concept of
* translucency (due to the bugs in the windowing system).
*/
private static boolean isWindowOpacitySupported() {
Toolkit curToolkit = Toolkit.getDefaultToolkit();
if (!(curToolkit instanceof SunToolkit)) {
return false;
}
return ((SunToolkit)curToolkit).isWindowOpacitySupported();
}
/**
* Set the opacity of the window. The opacity is at the range [0..1].
* Note that setting the opacity level of 0 may or may not disable
* the mouse event handling on this window. This is
* a platform-dependent behavior.
*
* In order for this method to enable the translucency effect,
* the isTranslucencySupported() method should indicate that the
* TRANSLUCENT level of translucency is supported.
*
* <p>Also note that the window must not be in the full-screen mode
* when setting the opacity value &lt; 1.0f. Otherwise
* the IllegalArgumentException is thrown.
*
* @param window the window to set the opacity level to
* @param opacity the opacity level to set to the window
* @throws NullPointerException if the window argument is null
* @throws IllegalArgumentException if the opacity is out of
* the range [0..1]
* @throws IllegalArgumentException if the window is in full screen mode,
* and the opacity is less than 1.0f
* @throws UnsupportedOperationException if the TRANSLUCENT translucency
* kind is not supported
*/
public static void setWindowOpacity(Window window, float opacity) {
if (window == null) {
throw new NullPointerException(
"The window argument should not be null.");
}
AWTAccessor.getWindowAccessor().setOpacity(window, opacity);
}
/**
* Get the opacity of the window. If the opacity has not
* yet being set, this method returns 1.0.
*
* @param window the window to get the opacity level from
* @throws NullPointerException if the window argument is null
*/
public static float getWindowOpacity(Window window) {
if (window == null) {
throw new NullPointerException(
"The window argument should not be null.");
}
return AWTAccessor.getWindowAccessor().getOpacity(window);
}
/**
* Returns whether the windowing system supports changing the shape
* of top-level windows.
* Note that this method may sometimes return true, but the native
* windowing system may still not support the concept of
* shaping (due to the bugs in the windowing system).
*/
public static boolean isWindowShapingSupported() {
Toolkit curToolkit = Toolkit.getDefaultToolkit();
if (!(curToolkit instanceof SunToolkit)) {
return false;
}
return ((SunToolkit)curToolkit).isWindowShapingSupported();
}
/**
* Returns an object that implements the Shape interface and represents
* the shape previously set with the call to the setWindowShape() method.
* If no shape has been set yet, or the shape has been reset to null,
* this method returns null.
*
* @param window the window to get the shape from
* @return the current shape of the window
* @throws NullPointerException if the window argument is null
*/
public static Shape getWindowShape(Window window) {
if (window == null) {
throw new NullPointerException(
"The window argument should not be null.");
}
return AWTAccessor.getWindowAccessor().getShape(window);
}
/**
* Sets a shape for the given window.
* If the shape argument is null, this methods restores
* the default shape making the window rectangular.
* <p>Note that in order to set a shape, the window must be undecorated.
* If the window is decorated, this method ignores the {@code shape}
* argument and resets the shape to null.
* <p>Also note that the window must not be in the full-screen mode
* when setting a non-null shape. Otherwise the IllegalArgumentException
* is thrown.
* <p>Depending on the platform, the method may return without
* effecting the shape of the window if the window has a non-null warning
* string ({@link Window#getWarningString()}). In this case the passed
* shape object is ignored.
*
* @param window the window to set the shape to
* @param shape the shape to set to the window
* @throws NullPointerException if the window argument is null
* @throws IllegalArgumentException if the window is in full screen mode,
* and the shape is not null
* @throws UnsupportedOperationException if the PERPIXEL_TRANSPARENT
* translucency kind is not supported
*/
public static void setWindowShape(Window window, Shape shape) {
if (window == null) {
throw new NullPointerException(
"The window argument should not be null.");
}
AWTAccessor.getWindowAccessor().setShape(window, shape);
}
private static boolean isWindowTranslucencySupported() {
/*
* Per-pixel alpha is supported if all the conditions are TRUE:
* 1. The toolkit is a sort of SunToolkit
* 2. The toolkit supports translucency in general
* (isWindowTranslucencySupported())
* 3. There's at least one translucency-capable
* GraphicsConfiguration
*/
Toolkit curToolkit = Toolkit.getDefaultToolkit();
if (!(curToolkit instanceof SunToolkit)) {
return false;
}
if (!((SunToolkit)curToolkit).isWindowTranslucencySupported()) {
return false;
}
GraphicsEnvironment env =
GraphicsEnvironment.getLocalGraphicsEnvironment();
// If the default GC supports translucency return true.
// It is important to optimize the verification this way,
// see CR 6661196 for more details.
if (isTranslucencyCapable(env.getDefaultScreenDevice()
.getDefaultConfiguration()))
{
return true;
}
// ... otherwise iterate through all the GCs.
GraphicsDevice[] devices = env.getScreenDevices();
for (int i = 0; i < devices.length; i++) {
GraphicsConfiguration[] configs = devices[i].getConfigurations();
for (int j = 0; j < configs.length; j++) {
if (isTranslucencyCapable(configs[j])) {
return true;
}
}
}
return false;
}
/**
* Enables the per-pixel alpha support for the given window.
* Once the window becomes non-opaque (the isOpaque is set to false),
* the drawing sub-system is starting to respect the alpha value of each
* separate pixel. If a pixel gets painted with alpha color component
* equal to zero, it becomes visually transparent, if the alpha of the
* pixel is equal to 255, the pixel is fully opaque. Interim values
* of the alpha color component make the pixel semi-transparent (i.e.
* translucent).
* <p>Note that in order for the window to support the per-pixel alpha
* mode, the window must be created using the GraphicsConfiguration
* for which the {@link #isTranslucencyCapable}
* method returns true.
* <p>Also note that some native systems enable the per-pixel translucency
* mode for any window created using the translucency-compatible
* graphics configuration. However, it is highly recommended to always
* invoke the setWindowOpaque() method for these windows, at least for
* the sake of cross-platform compatibility reasons.
* <p>Also note that the window must not be in the full-screen mode
* when making it non-opaque. Otherwise the IllegalArgumentException
* is thrown.
* <p>If the window is a {@code Frame} or a {@code Dialog}, the window must
* be undecorated prior to enabling the per-pixel translucency effect (see
* {@link Frame#setUndecorated()} and/or {@link Dialog#setUndecorated()}).
* If the window becomes decorated through a subsequent call to the
* corresponding {@code setUndecorated()} method, the per-pixel
* translucency effect will be disabled and the opaque property reset to
* {@code true}.
* <p>Depending on the platform, the method may return without
* effecting the opaque property of the window if the window has a non-null
* warning string ({@link Window#getWarningString()}). In this case
* the passed 'isOpaque' value is ignored.
*
* @param window the window to set the shape to
* @param isOpaque whether the window must be opaque (true),
* or translucent (false)
* @throws NullPointerException if the window argument is null
* @throws IllegalArgumentException if the window uses
* a GraphicsConfiguration for which the
* {@code isTranslucencyCapable()}
* method returns false
* @throws IllegalArgumentException if the window is in full screen mode,
* and the isOpaque is false
* @throws IllegalArgumentException if the window is decorated and the
* isOpaque argument is {@code false}.
* @throws UnsupportedOperationException if the PERPIXEL_TRANSLUCENT
* translucency kind is not supported
*/
public static void setWindowOpaque(Window window, boolean isOpaque) {
if (window == null) {
throw new NullPointerException(
"The window argument should not be null.");
}
if (!isOpaque && !isTranslucencySupported(Translucency.PERPIXEL_TRANSLUCENT)) {
throw new UnsupportedOperationException(
"The PERPIXEL_TRANSLUCENT translucency kind is not supported");
}
AWTAccessor.getWindowAccessor().setOpaque(window, isOpaque);
}
/**
* Returns whether the window is opaque or translucent.
*
* @param window the window to set the shape to
* @return whether the window is currently opaque (true)
* or translucent (false)
* @throws NullPointerException if the window argument is null
*/
public static boolean isWindowOpaque(Window window) {
if (window == null) {
throw new NullPointerException(
"The window argument should not be null.");
}
return AWTAccessor.getWindowAccessor().isOpaque(window);
}
/**
* Verifies whether a given GraphicsConfiguration supports
* the PERPIXEL_TRANSLUCENT kind of translucency.
* All windows that are intended to be used with the {@link #setWindowOpaque}
* method must be created using a GraphicsConfiguration for which this method
* returns true.
* <p>Note that some native systems enable the per-pixel translucency
* mode for any window created using a translucency-capable
* graphics configuration. However, it is highly recommended to always
* invoke the setWindowOpaque() method for these windows, at least
* for the sake of cross-platform compatibility reasons.
*
* @param gc GraphicsConfiguration
* @throws NullPointerException if the gc argument is null
* @return whether the given GraphicsConfiguration supports
* the translucency effects.
*/
public static boolean isTranslucencyCapable(GraphicsConfiguration gc) {
if (gc == null) {
throw new NullPointerException("The gc argument should not be null");
}
/*
return gc.isTranslucencyCapable();
*/
Toolkit curToolkit = Toolkit.getDefaultToolkit();
if (!(curToolkit instanceof SunToolkit)) {
return false;
}
return ((SunToolkit)curToolkit).isTranslucencyCapable(gc);
}
/** /**
* Sets a 'mixing-cutout' shape for the given component. * Sets a 'mixing-cutout' shape for the given component.
* *
......
/*
* Copyright 2008-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.awt;
import java.awt.*;
import java.awt.geom.*;
import sun.awt.AWTAccessor;
/**
* Security Warning control interface.
*
* This class provides a couple of methods that help a developer relocate
* the AWT security warning to an appropriate position relative to the current
* window size. A "top-level window" is an instance of the {@code Window}
* class (or its descendant, such as {@code JFrame}). The security warning
* is applied to all windows created by an untrusted code. All such windows
* have a non-null "warning string" (see {@link Window#getWarningString()}).
* <p>
* <b>WARNING</b>: This class is an implementation detail and only meant
* for limited use outside of the core platform. This API may change
* drastically between update release, and it may even be
* removed or be moved to some other packages or classes.
*/
public final class SecurityWarning {
/**
* The SecurityWarning class should not be instantiated
*/
private SecurityWarning() {
}
/**
* Gets the size of the security warning.
*
* The returned value is not valid until the peer has been created. Before
* invoking this method a developer must call the {@link Window#pack()},
* {@link Window#setVisible()}, or some other method that creates the peer.
*
* @param window the window to get the security warning size for
*
* @throws NullPointerException if the window argument is null
* @throws IllegalArgumentException if the window is trusted (i.e.
* the {@code getWarningString()} returns null)
*/
public static Dimension getSize(Window window) {
if (window == null) {
throw new NullPointerException(
"The window argument should not be null.");
}
if (window.getWarningString() == null) {
throw new IllegalArgumentException(
"The window must have a non-null warning string.");
}
// We don't check for a non-null peer since it may be destroyed
// after assigning a valid value to the security warning size.
return AWTAccessor.getWindowAccessor().getSecurityWarningSize(window);
}
/**
* Sets the position of the security warning.
* <p>
* The {@code alignmentX} and {@code alignmentY} arguments specify the
* origin of the coordinate system used to calculate the position of the
* security warning. The values must be in the range [0.0f...1.0f]. The
* {@code 0.0f} value represents the left (top) edge of the rectangular
* bounds of the window. The {@code 1.0f} value represents the right
* (bottom) edge of the bounds. Whenever the size of the window changes,
* the origin of the coordinate system gets relocated accordingly. For
* convenience a developer may use the {@code Component.*_ALIGNMENT}
* constants to pass predefined values for these arguments.
* <p>
* The {@code point} argument specifies the location of the security
* warning in the coordinate system described above. If both {@code x} and
* {@code y} coordinates of the point are equal to zero, the warning will
* be located right in the origin of the coordinate system. On the other
* hand, if both {@code alignmentX} and {@code alignmentY} are equal to
* zero (i.e. the origin of the coordinate system is placed at the top-left
* corner of the window), then the {@code point} argument represents the
* absolute location of the security warning relative to the location of
* the window. The "absolute" in this case means that the position of the
* security warning is not effected by resizing of the window.
* <p>
* Note that the security warning managment code guarantees that:
* <ul>
* <li>The security warning cannot be located farther than two pixels from
* the rectangular bounds of the window (see {@link Window#getBounds}), and
* <li>The security warning is always visible on the screen.
* </ul>
* If either of the conditions is violated, the calculated position of the
* security warning is adjusted by the system to meet both these
* conditions.
* <p>
* The default position of the security warning is in the upper-right
* corner of the window, two pixels to the right from the right edge. This
* corresponds to the following arguments passed to this method:
* <ul>
* <li>{@code alignmentX = Component.RIGHT_ALIGNMENT}
* <li>{@code alignmentY = Component.TOP_ALIGNMENT}
* <li>{@code point = (2, 0)}
* </ul>
*
* @param window the window to set the position of the security warning for
* @param alignmentX the horizontal origin of the coordinate system
* @param alignmentY the vertical origin of the coordinate system
* @param point the position of the security warning in the specified
* coordinate system
*
* @throws NullPointerException if the window argument is null
* @throws NullPointerException if the point argument is null
* @throws IllegalArgumentException if the window is trusted (i.e.
* the {@code getWarningString()} returns null
* @throws IllegalArgumentException if the alignmentX or alignmentY
* arguments are not within the range [0.0f ... 1.0f]
*/
public static void setPosition(Window window, Point2D point,
float alignmentX, float alignmentY)
{
if (window == null) {
throw new NullPointerException(
"The window argument should not be null.");
}
if (window.getWarningString() == null) {
throw new IllegalArgumentException(
"The window must have a non-null warning string.");
}
if (point == null) {
throw new NullPointerException(
"The point argument must not be null");
}
if (alignmentX < 0.0f || alignmentX > 1.0f) {
throw new IllegalArgumentException(
"alignmentX must be in the range [0.0f ... 1.0f].");
}
if (alignmentY < 0.0f || alignmentY > 1.0f) {
throw new IllegalArgumentException(
"alignmentY must be in the range [0.0f ... 1.0f].");
}
AWTAccessor.getWindowAccessor().setSecurityWarningPosition(window,
point, alignmentX, alignmentY);
}
}
...@@ -279,6 +279,7 @@ class GTKIconFactory { ...@@ -279,6 +279,7 @@ class GTKIconFactory {
public void paintIcon(SynthContext context, Graphics g, int x, int y, public void paintIcon(SynthContext context, Graphics g, int x, int y,
int w, int h) { int w, int h) {
if (context != null) {
JToolBar toolbar = (JToolBar)context.getComponent(); JToolBar toolbar = (JToolBar)context.getComponent();
Orientation orientation = Orientation orientation =
(toolbar.getOrientation() == JToolBar.HORIZONTAL ? (toolbar.getOrientation() == JToolBar.HORIZONTAL ?
...@@ -294,6 +295,7 @@ class GTKIconFactory { ...@@ -294,6 +295,7 @@ class GTKIconFactory {
GTKPainter.INSTANCE.paintIcon(context, g, GTKPainter.INSTANCE.paintIcon(context, g,
getMethod(), x, y, w, h, orientation); getMethod(), x, y, w, h, orientation);
} }
}
public int getIconWidth(SynthContext context) { public int getIconWidth(SynthContext context) {
if (context == null) { if (context == null) {
...@@ -336,6 +338,7 @@ class GTKIconFactory { ...@@ -336,6 +338,7 @@ class GTKIconFactory {
public void paintIcon(SynthContext context, Graphics g, int x, int y, public void paintIcon(SynthContext context, Graphics g, int x, int y,
int w, int h) { int w, int h) {
if (context != null) {
ArrowType arrowDir = ArrowType.RIGHT; ArrowType arrowDir = ArrowType.RIGHT;
if (!context.getComponent().getComponentOrientation().isLeftToRight()) { if (!context.getComponent().getComponentOrientation().isLeftToRight()) {
arrowDir = ArrowType.LEFT; arrowDir = ArrowType.LEFT;
...@@ -344,4 +347,5 @@ class GTKIconFactory { ...@@ -344,4 +347,5 @@ class GTKIconFactory {
getMethod(), x, y, w, h, arrowDir); getMethod(), x, y, w, h, arrowDir);
} }
} }
}
} }
...@@ -39,6 +39,8 @@ import java.io.File; ...@@ -39,6 +39,8 @@ import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.*;
import java.security.AccessController;
import java.security.PrivilegedAction;
import sun.awt.shell.ShellFolder; import sun.awt.shell.ShellFolder;
import sun.awt.OSInfo; import sun.awt.OSInfo;
...@@ -1143,7 +1145,11 @@ public class WindowsFileChooserUI extends BasicFileChooserUI { ...@@ -1143,7 +1145,11 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
File[] baseFolders; File[] baseFolders;
if (useShellFolder) { if (useShellFolder) {
baseFolders = (File[])ShellFolder.get("fileChooserComboBoxFolders"); baseFolders = AccessController.doPrivileged(new PrivilegedAction<File[]>() {
public File[] run() {
return (File[]) ShellFolder.get("fileChooserComboBoxFolders");
}
});
} else { } else {
baseFolders = fsv.getRoots(); baseFolders = fsv.getRoots();
} }
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*/ */
package com.sun.jmx.remote.internal; package com.sun.jmx.remote.internal;
import java.io.IOException; import java.io.IOException;
...@@ -34,6 +33,7 @@ import java.util.List; ...@@ -34,6 +33,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.security.AccessControlContext;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
import javax.security.auth.Subject; import javax.security.auth.Subject;
...@@ -54,7 +54,10 @@ import com.sun.jmx.remote.util.EnvHelp; ...@@ -54,7 +54,10 @@ import com.sun.jmx.remote.util.EnvHelp;
public abstract class ClientNotifForwarder { public abstract class ClientNotifForwarder {
public ClientNotifForwarder(Map<String, ?> env) {
private final AccessControlContext acc;
public ClientNotifForwarder(Map env) {
this(null, env); this(null, env);
} }
...@@ -87,6 +90,8 @@ public abstract class ClientNotifForwarder { ...@@ -87,6 +90,8 @@ public abstract class ClientNotifForwarder {
this.command = command; this.command = command;
if (thread == null) { if (thread == null) {
thread = new Thread() { thread = new Thread() {
@Override
public void run() { public void run() {
while (true) { while (true) {
Runnable r; Runnable r;
...@@ -130,6 +135,7 @@ public abstract class ClientNotifForwarder { ...@@ -130,6 +135,7 @@ public abstract class ClientNotifForwarder {
this.defaultClassLoader = defaultClassLoader; this.defaultClassLoader = defaultClassLoader;
this.executor = ex; this.executor = ex;
this.acc = AccessController.getContext();
} }
/** /**
...@@ -380,29 +386,86 @@ public abstract class ClientNotifForwarder { ...@@ -380,29 +386,86 @@ public abstract class ClientNotifForwarder {
setState(TERMINATED); setState(TERMINATED);
} }
// -------------------------------------------------
// private classes // -------------------------------------------------
// ------------------------------------------------- // private classes
// -------------------------------------------------
// //
private class NotifFetcher implements Runnable { private class NotifFetcher implements Runnable {
private volatile boolean alreadyLogged = false;
private void logOnce(String msg, SecurityException x) {
if (alreadyLogged) return;
// Log only once.
logger.config("setContextClassLoader",msg);
if (x != null) logger.fine("setContextClassLoader", x);
alreadyLogged = true;
}
// Set new context class loader, returns previous one.
private final ClassLoader setContextClassLoader(final ClassLoader loader) {
final AccessControlContext ctxt = ClientNotifForwarder.this.acc;
// if ctxt is null, log a config message and throw a
// SecurityException.
if (ctxt == null) {
logOnce("AccessControlContext must not be null.",null);
throw new SecurityException("AccessControlContext must not be null");
}
return AccessController.doPrivileged(
new PrivilegedAction<ClassLoader>() {
public ClassLoader run() {
try {
// get context class loader - may throw
// SecurityException - though unlikely.
final ClassLoader previous =
Thread.currentThread().getContextClassLoader();
// if nothing needs to be done, break here...
if (loader == previous) return previous;
// reset context class loader - may throw
// SecurityException
Thread.currentThread().setContextClassLoader(loader);
return previous;
} catch (SecurityException x) {
logOnce("Permission to set ContextClassLoader missing. " +
"Notifications will not be dispatched. " +
"Please check your Java policy configuration: " +
x, x);
throw x;
}
}
}, ctxt);
}
public void run() { public void run() {
final ClassLoader previous;
if (defaultClassLoader != null) {
previous = setContextClassLoader(defaultClassLoader);
} else {
previous = null;
}
try {
doRun();
} finally {
if (defaultClassLoader != null) {
setContextClassLoader(previous);
}
}
}
private void doRun() {
synchronized (ClientNotifForwarder.this) { synchronized (ClientNotifForwarder.this) {
currentFetchThread = Thread.currentThread(); currentFetchThread = Thread.currentThread();
if (state == STARTING) if (state == STARTING) {
setState(STARTED); setState(STARTED);
} }
if (defaultClassLoader != null) {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {
Thread.currentThread().
setContextClassLoader(defaultClassLoader);
return null;
}
});
} }
NotificationResult nr = null; NotificationResult nr = null;
if (!shouldStop() && (nr = fetchNotifs()) != null) { if (!shouldStop() && (nr = fetchNotifs()) != null) {
// nr == null means got exception // nr == null means got exception
...@@ -434,8 +497,9 @@ public abstract class ClientNotifForwarder { ...@@ -434,8 +497,9 @@ public abstract class ClientNotifForwarder {
// check if an mbean unregistration notif // check if an mbean unregistration notif
if (!listenerID.equals(mbeanRemovedNotifID)) { if (!listenerID.equals(mbeanRemovedNotifID)) {
final ClientListenerInfo li = infoList.get(listenerID); final ClientListenerInfo li = infoList.get(listenerID);
if (li != null) if (li != null) {
listeners.put(listenerID,li); listeners.put(listenerID, li);
}
continue; continue;
} }
final Notification notif = tn.getNotification(); final Notification notif = tn.getNotification();
...@@ -799,9 +863,7 @@ public abstract class ClientNotifForwarder { ...@@ -799,9 +863,7 @@ public abstract class ClientNotifForwarder {
private long clientSequenceNumber = -1; private long clientSequenceNumber = -1;
private final int maxNotifications; private final int maxNotifications;
private final long timeout; private final long timeout;
private Integer mbeanRemovedNotifID = null; private Integer mbeanRemovedNotifID = null;
private Thread currentFetchThread; private Thread currentFetchThread;
// state // state
......
...@@ -111,6 +111,22 @@ public abstract class MBeanServerAccessController ...@@ -111,6 +111,22 @@ public abstract class MBeanServerAccessController
*/ */
protected abstract void checkWrite(); protected abstract void checkWrite();
/**
* Check if the caller can create the named class. The default
* implementation of this method calls {@link #checkWrite()}.
*/
protected void checkCreate(String className) {
checkWrite();
}
/**
* Check if the caller can unregister the named MBean. The default
* implementation of this method calls {@link #checkWrite()}.
*/
protected void checkUnregister(ObjectName name) {
checkWrite();
}
//-------------------------------------------- //--------------------------------------------
//-------------------------------------------- //--------------------------------------------
// //
...@@ -148,7 +164,7 @@ public abstract class MBeanServerAccessController ...@@ -148,7 +164,7 @@ public abstract class MBeanServerAccessController
} }
/** /**
* Call <code>checkWrite()</code>, then forward this method to the * Call <code>checkCreate(className)</code>, then forward this method to the
* wrapped object. * wrapped object.
*/ */
public ObjectInstance createMBean(String className, ObjectName name) public ObjectInstance createMBean(String className, ObjectName name)
...@@ -158,7 +174,7 @@ public abstract class MBeanServerAccessController ...@@ -158,7 +174,7 @@ public abstract class MBeanServerAccessController
MBeanRegistrationException, MBeanRegistrationException,
MBeanException, MBeanException,
NotCompliantMBeanException { NotCompliantMBeanException {
checkWrite(); checkCreate(className);
SecurityManager sm = System.getSecurityManager(); SecurityManager sm = System.getSecurityManager();
if (sm == null) { if (sm == null) {
Object object = getMBeanServer().instantiate(className); Object object = getMBeanServer().instantiate(className);
...@@ -170,7 +186,7 @@ public abstract class MBeanServerAccessController ...@@ -170,7 +186,7 @@ public abstract class MBeanServerAccessController
} }
/** /**
* Call <code>checkWrite()</code>, then forward this method to the * Call <code>checkCreate(className)</code>, then forward this method to the
* wrapped object. * wrapped object.
*/ */
public ObjectInstance createMBean(String className, ObjectName name, public ObjectInstance createMBean(String className, ObjectName name,
...@@ -181,7 +197,7 @@ public abstract class MBeanServerAccessController ...@@ -181,7 +197,7 @@ public abstract class MBeanServerAccessController
MBeanRegistrationException, MBeanRegistrationException,
MBeanException, MBeanException,
NotCompliantMBeanException { NotCompliantMBeanException {
checkWrite(); checkCreate(className);
SecurityManager sm = System.getSecurityManager(); SecurityManager sm = System.getSecurityManager();
if (sm == null) { if (sm == null) {
Object object = getMBeanServer().instantiate(className, Object object = getMBeanServer().instantiate(className,
...@@ -196,7 +212,7 @@ public abstract class MBeanServerAccessController ...@@ -196,7 +212,7 @@ public abstract class MBeanServerAccessController
} }
/** /**
* Call <code>checkWrite()</code>, then forward this method to the * Call <code>checkCreate(className)</code>, then forward this method to the
* wrapped object. * wrapped object.
*/ */
public ObjectInstance createMBean(String className, public ObjectInstance createMBean(String className,
...@@ -209,7 +225,7 @@ public abstract class MBeanServerAccessController ...@@ -209,7 +225,7 @@ public abstract class MBeanServerAccessController
MBeanException, MBeanException,
NotCompliantMBeanException, NotCompliantMBeanException,
InstanceNotFoundException { InstanceNotFoundException {
checkWrite(); checkCreate(className);
SecurityManager sm = System.getSecurityManager(); SecurityManager sm = System.getSecurityManager();
if (sm == null) { if (sm == null) {
Object object = getMBeanServer().instantiate(className, Object object = getMBeanServer().instantiate(className,
...@@ -222,7 +238,7 @@ public abstract class MBeanServerAccessController ...@@ -222,7 +238,7 @@ public abstract class MBeanServerAccessController
} }
/** /**
* Call <code>checkWrite()</code>, then forward this method to the * Call <code>checkCreate(className)</code>, then forward this method to the
* wrapped object. * wrapped object.
*/ */
public ObjectInstance createMBean(String className, public ObjectInstance createMBean(String className,
...@@ -237,7 +253,7 @@ public abstract class MBeanServerAccessController ...@@ -237,7 +253,7 @@ public abstract class MBeanServerAccessController
MBeanException, MBeanException,
NotCompliantMBeanException, NotCompliantMBeanException,
InstanceNotFoundException { InstanceNotFoundException {
checkWrite(); checkCreate(className);
SecurityManager sm = System.getSecurityManager(); SecurityManager sm = System.getSecurityManager();
if (sm == null) { if (sm == null) {
Object object = getMBeanServer().instantiate(className, Object object = getMBeanServer().instantiate(className,
...@@ -394,45 +410,45 @@ public abstract class MBeanServerAccessController ...@@ -394,45 +410,45 @@ public abstract class MBeanServerAccessController
} }
/** /**
* Call <code>checkWrite()</code>, then forward this method to the * Call <code>checkCreate(className)</code>, then forward this method to the
* wrapped object. * wrapped object.
*/ */
public Object instantiate(String className) public Object instantiate(String className)
throws ReflectionException, MBeanException { throws ReflectionException, MBeanException {
checkWrite(); checkCreate(className);
return getMBeanServer().instantiate(className); return getMBeanServer().instantiate(className);
} }
/** /**
* Call <code>checkWrite()</code>, then forward this method to the * Call <code>checkCreate(className)</code>, then forward this method to the
* wrapped object. * wrapped object.
*/ */
public Object instantiate(String className, public Object instantiate(String className,
Object params[], Object params[],
String signature[]) String signature[])
throws ReflectionException, MBeanException { throws ReflectionException, MBeanException {
checkWrite(); checkCreate(className);
return getMBeanServer().instantiate(className, params, signature); return getMBeanServer().instantiate(className, params, signature);
} }
/** /**
* Call <code>checkWrite()</code>, then forward this method to the * Call <code>checkCreate(className)</code>, then forward this method to the
* wrapped object. * wrapped object.
*/ */
public Object instantiate(String className, ObjectName loaderName) public Object instantiate(String className, ObjectName loaderName)
throws ReflectionException, MBeanException, InstanceNotFoundException { throws ReflectionException, MBeanException, InstanceNotFoundException {
checkWrite(); checkCreate(className);
return getMBeanServer().instantiate(className, loaderName); return getMBeanServer().instantiate(className, loaderName);
} }
/** /**
* Call <code>checkWrite()</code>, then forward this method to the * Call <code>checkCreate(className)</code>, then forward this method to the
* wrapped object. * wrapped object.
*/ */
public Object instantiate(String className, ObjectName loaderName, public Object instantiate(String className, ObjectName loaderName,
Object params[], String signature[]) Object params[], String signature[])
throws ReflectionException, MBeanException, InstanceNotFoundException { throws ReflectionException, MBeanException, InstanceNotFoundException {
checkWrite(); checkCreate(className);
return getMBeanServer().instantiate(className, loaderName, return getMBeanServer().instantiate(className, loaderName,
params, signature); params, signature);
} }
...@@ -579,12 +595,12 @@ public abstract class MBeanServerAccessController ...@@ -579,12 +595,12 @@ public abstract class MBeanServerAccessController
} }
/** /**
* Call <code>checkWrite()</code>, then forward this method to the * Call <code>checkUnregister()</code>, then forward this method to the
* wrapped object. * wrapped object.
*/ */
public void unregisterMBean(ObjectName name) public void unregisterMBean(ObjectName name)
throws InstanceNotFoundException, MBeanRegistrationException { throws InstanceNotFoundException, MBeanRegistrationException {
checkWrite(); checkUnregister(name);
getMBeanServer().unregisterMBean(name); getMBeanServer().unregisterMBean(name);
} }
......
...@@ -31,11 +31,17 @@ import java.security.AccessControlContext; ...@@ -31,11 +31,17 @@ import java.security.AccessControlContext;
import java.security.AccessController; import java.security.AccessController;
import java.security.Principal; import java.security.Principal;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
import java.util.Collection; import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.Set; import java.util.Set;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
import javax.management.MBeanServer; import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.security.auth.Subject; import javax.security.auth.Subject;
/** /**
...@@ -46,7 +52,8 @@ import javax.security.auth.Subject; ...@@ -46,7 +52,8 @@ import javax.security.auth.Subject;
* not allowed; in this case the request is not forwarded to the * not allowed; in this case the request is not forwarded to the
* wrapped object.</p> * wrapped object.</p>
* *
* <p>This class implements the {@link #checkRead()} and {@link #checkWrite()} * <p>This class implements the {@link #checkRead()}, {@link #checkWrite()},
* {@link #checkCreate(String)}, and {@link #checkUnregister(ObjectName)}
* methods based on an access level properties file containing username/access * methods based on an access level properties file containing username/access
* level pairs. The set of username/access level pairs is passed either as a * level pairs. The set of username/access level pairs is passed either as a
* filename which denotes a properties file on disk, or directly as an instance * filename which denotes a properties file on disk, or directly as an instance
...@@ -56,14 +63,50 @@ import javax.security.auth.Subject; ...@@ -56,14 +63,50 @@ import javax.security.auth.Subject;
* has exactly one access level. The same access level can be shared by several * has exactly one access level. The same access level can be shared by several
* usernames.</p> * usernames.</p>
* *
* <p>The supported access level values are <i>readonly</i> and * <p>The supported access level values are {@code readonly} and
* <i>readwrite</i>.</p> * {@code readwrite}. The {@code readwrite} access level can be
* qualified by one or more <i>clauses</i>, where each clause looks
* like <code>create <i>classNamePattern</i></code> or {@code
* unregister}. For example:</p>
*
* <pre>
* monitorRole readonly
* controlRole readwrite \
* create javax.management.timer.*,javax.management.monitor.* \
* unregister
* </pre>
*
* <p>(The continuation lines with {@code \} come from the parser for
* Properties files.)</p>
*/ */
public class MBeanServerFileAccessController public class MBeanServerFileAccessController
extends MBeanServerAccessController { extends MBeanServerAccessController {
public static final String READONLY = "readonly"; static final String READONLY = "readonly";
public static final String READWRITE = "readwrite"; static final String READWRITE = "readwrite";
static final String CREATE = "create";
static final String UNREGISTER = "unregister";
private enum AccessType {READ, WRITE, CREATE, UNREGISTER};
private static class Access {
final boolean write;
final String[] createPatterns;
private boolean unregister;
Access(boolean write, boolean unregister, List<String> createPatternList) {
this.write = write;
int npats = (createPatternList == null) ? 0 : createPatternList.size();
if (npats == 0)
this.createPatterns = NO_STRINGS;
else
this.createPatterns = createPatternList.toArray(new String[npats]);
this.unregister = unregister;
}
private final String[] NO_STRINGS = new String[0];
}
/** /**
* <p>Create a new MBeanServerAccessController that forwards all the * <p>Create a new MBeanServerAccessController that forwards all the
...@@ -87,8 +130,8 @@ public class MBeanServerFileAccessController ...@@ -87,8 +130,8 @@ public class MBeanServerFileAccessController
throws IOException { throws IOException {
super(); super();
this.accessFileName = accessFileName; this.accessFileName = accessFileName;
props = propertiesFromFile(accessFileName); Properties props = propertiesFromFile(accessFileName);
checkValues(props); parseProperties(props);
} }
/** /**
...@@ -123,14 +166,14 @@ public class MBeanServerFileAccessController ...@@ -123,14 +166,14 @@ public class MBeanServerFileAccessController
* #setMBeanServer} method after doing access checks based on read and * #setMBeanServer} method after doing access checks based on read and
* write permissions.</p> * write permissions.</p>
* *
* <p>This instance is initialized from the specified properties instance. * <p>This instance is initialized from the specified properties
* This constructor makes a copy of the properties instance using its * instance. This constructor makes a copy of the properties
* <code>clone</code> method and it is the copy that is consulted to check * instance and it is the copy that is consulted to check the
* the username and access level of an incoming connection. The original * username and access level of an incoming connection. The
* properties object can be modified without affecting the copy. If the * original properties object can be modified without affecting
* {@link #refresh} method is then called, the * the copy. If the {@link #refresh} method is then called, the
* <code>MBeanServerFileAccessController</code> will make a new copy of the * <code>MBeanServerFileAccessController</code> will make a new
* properties object at that time.</p> * copy of the properties object at that time.</p>
* *
* @param accessFileProps properties list containing the username/access * @param accessFileProps properties list containing the username/access
* level entries. * level entries.
...@@ -145,8 +188,7 @@ public class MBeanServerFileAccessController ...@@ -145,8 +188,7 @@ public class MBeanServerFileAccessController
if (accessFileProps == null) if (accessFileProps == null)
throw new IllegalArgumentException("Null properties"); throw new IllegalArgumentException("Null properties");
originalProps = accessFileProps; originalProps = accessFileProps;
props = (Properties) accessFileProps.clone(); parseProperties(accessFileProps);
checkValues(props);
} }
/** /**
...@@ -155,14 +197,14 @@ public class MBeanServerFileAccessController ...@@ -155,14 +197,14 @@ public class MBeanServerFileAccessController
* #setMBeanServer} method after doing access checks based on read and * #setMBeanServer} method after doing access checks based on read and
* write permissions.</p> * write permissions.</p>
* *
* <p>This instance is initialized from the specified properties instance. * <p>This instance is initialized from the specified properties
* This constructor makes a copy of the properties instance using its * instance. This constructor makes a copy of the properties
* <code>clone</code> method and it is the copy that is consulted to check * instance and it is the copy that is consulted to check the
* the username and access level of an incoming connection. The original * username and access level of an incoming connection. The
* properties object can be modified without affecting the copy. If the * original properties object can be modified without affecting
* {@link #refresh} method is then called, the * the copy. If the {@link #refresh} method is then called, the
* <code>MBeanServerFileAccessController</code> will make a new copy of the * <code>MBeanServerFileAccessController</code> will make a new
* properties object at that time.</p> * copy of the properties object at that time.</p>
* *
* @param accessFileProps properties list containing the username/access * @param accessFileProps properties list containing the username/access
* level entries. * level entries.
...@@ -184,16 +226,36 @@ public class MBeanServerFileAccessController ...@@ -184,16 +226,36 @@ public class MBeanServerFileAccessController
* Check if the caller can do read operations. This method does * Check if the caller can do read operations. This method does
* nothing if so, otherwise throws SecurityException. * nothing if so, otherwise throws SecurityException.
*/ */
@Override
public void checkRead() { public void checkRead() {
checkAccessLevel(READONLY); checkAccess(AccessType.READ, null);
} }
/** /**
* Check if the caller can do write operations. This method does * Check if the caller can do write operations. This method does
* nothing if so, otherwise throws SecurityException. * nothing if so, otherwise throws SecurityException.
*/ */
@Override
public void checkWrite() { public void checkWrite() {
checkAccessLevel(READWRITE); checkAccess(AccessType.WRITE, null);
}
/**
* Check if the caller can create MBeans or instances of the given class.
* This method does nothing if so, otherwise throws SecurityException.
*/
@Override
public void checkCreate(String className) {
checkAccess(AccessType.CREATE, className);
}
/**
* Check if the caller can do unregister operations. This method does
* nothing if so, otherwise throws SecurityException.
*/
@Override
public void checkUnregister(ObjectName name) {
checkAccess(AccessType.UNREGISTER, null);
} }
/** /**
...@@ -218,14 +280,13 @@ public class MBeanServerFileAccessController ...@@ -218,14 +280,13 @@ public class MBeanServerFileAccessController
* @exception IllegalArgumentException if any of the supplied access * @exception IllegalArgumentException if any of the supplied access
* level values differs from "readonly" or "readwrite". * level values differs from "readonly" or "readwrite".
*/ */
public void refresh() throws IOException { public synchronized void refresh() throws IOException {
synchronized (props) { Properties props;
if (accessFileName == null) if (accessFileName == null)
props = (Properties) originalProps.clone(); props = (Properties) originalProps;
else else
props = propertiesFromFile(accessFileName); props = propertiesFromFile(accessFileName);
checkValues(props); parseProperties(props);
}
} }
private static Properties propertiesFromFile(String fname) private static Properties propertiesFromFile(String fname)
...@@ -240,7 +301,7 @@ public class MBeanServerFileAccessController ...@@ -240,7 +301,7 @@ public class MBeanServerFileAccessController
} }
} }
private void checkAccessLevel(String accessLevel) { private synchronized void checkAccess(AccessType requiredAccess, String arg) {
final AccessControlContext acc = AccessController.getContext(); final AccessControlContext acc = AccessController.getContext();
final Subject s = final Subject s =
AccessController.doPrivileged(new PrivilegedAction<Subject>() { AccessController.doPrivileged(new PrivilegedAction<Subject>() {
...@@ -249,39 +310,235 @@ public class MBeanServerFileAccessController ...@@ -249,39 +310,235 @@ public class MBeanServerFileAccessController
} }
}); });
if (s == null) return; /* security has not been enabled */ if (s == null) return; /* security has not been enabled */
final Set<Principal> principals = s.getPrincipals(); final Set principals = s.getPrincipals();
for (Principal p : principals) { String newPropertyValue = null;
String grantedAccessLevel; for (Iterator i = principals.iterator(); i.hasNext(); ) {
synchronized (props) { final Principal p = (Principal) i.next();
grantedAccessLevel = props.getProperty(p.getName()); Access access = accessMap.get(p.getName());
} if (access != null) {
if (grantedAccessLevel != null) { boolean ok;
if (accessLevel.equals(READONLY) && switch (requiredAccess) {
(grantedAccessLevel.equals(READONLY) || case READ:
grantedAccessLevel.equals(READWRITE))) ok = true; // all access entries imply read
return; break;
if (accessLevel.equals(READWRITE) && case WRITE:
grantedAccessLevel.equals(READWRITE)) ok = access.write;
break;
case UNREGISTER:
ok = access.unregister;
if (!ok && access.write)
newPropertyValue = "unregister";
break;
case CREATE:
ok = checkCreateAccess(access, arg);
if (!ok && access.write)
newPropertyValue = "create " + arg;
break;
default:
throw new AssertionError();
}
if (ok)
return; return;
} }
} }
throw new SecurityException("Access denied! Invalid access level for " + SecurityException se = new SecurityException("Access denied! Invalid " +
"requested MBeanServer operation."); "access level for requested MBeanServer operation.");
// Add some more information to help people with deployments that
// worked before we required explicit create clauses. We're not giving
// any information to the bad guys, other than that the access control
// is based on a file, which they could have worked out from the stack
// trace anyway.
if (newPropertyValue != null) {
SecurityException se2 = new SecurityException("Access property " +
"for this identity should be similar to: " + READWRITE +
" " + newPropertyValue);
se.initCause(se2);
}
throw se;
}
private static boolean checkCreateAccess(Access access, String className) {
for (String classNamePattern : access.createPatterns) {
if (classNameMatch(classNamePattern, className))
return true;
}
return false;
}
private static boolean classNameMatch(String pattern, String className) {
// We studiously avoided regexes when parsing the properties file,
// because that is done whenever the VM is started with the
// appropriate -Dcom.sun.management options, even if nobody ever
// creates an MBean. We don't want to incur the overhead of loading
// all the regex code whenever those options are specified, but if we
// get as far as here then the VM is already running and somebody is
// doing the very unusual operation of remotely creating an MBean.
// Because that operation is so unusual, we don't try to optimize
// by hand-matching or by caching compiled Pattern objects.
StringBuilder sb = new StringBuilder();
StringTokenizer stok = new StringTokenizer(pattern, "*", true);
while (stok.hasMoreTokens()) {
String tok = stok.nextToken();
if (tok.equals("*"))
sb.append("[^.]*");
else
sb.append(Pattern.quote(tok));
}
return className.matches(sb.toString());
}
private void parseProperties(Properties props) {
this.accessMap = new HashMap<String, Access>();
for (Map.Entry<Object, Object> entry : props.entrySet()) {
String identity = (String) entry.getKey();
String accessString = (String) entry.getValue();
Access access = Parser.parseAccess(identity, accessString);
accessMap.put(identity, access);
}
}
private static class Parser {
private final static int EOS = -1; // pseudo-codepoint "end of string"
static {
assert !Character.isWhitespace(EOS);
}
private final String identity; // just for better error messages
private final String s; // the string we're parsing
private final int len; // s.length()
private int i;
private int c;
// At any point, either c is s.codePointAt(i), or i == len and
// c is EOS. We use int rather than char because it is conceivable
// (if unlikely) that a classname in a create clause might contain
// "supplementary characters", the ones that don't fit in the original
// 16 bits for Unicode.
private Parser(String identity, String s) {
this.identity = identity;
this.s = s;
this.len = s.length();
this.i = 0;
if (i < len)
this.c = s.codePointAt(i);
else
this.c = EOS;
}
static Access parseAccess(String identity, String s) {
return new Parser(identity, s).parseAccess();
}
private Access parseAccess() {
skipSpace();
String type = parseWord();
Access access;
if (type.equals(READONLY))
access = new Access(false, false, null);
else if (type.equals(READWRITE))
access = parseReadWrite();
else {
throw syntax("Expected " + READONLY + " or " + READWRITE +
": " + type);
}
if (c != EOS)
throw syntax("Extra text at end of line");
return access;
}
private Access parseReadWrite() {
List<String> createClasses = new ArrayList<String>();
boolean unregister = false;
while (true) {
skipSpace();
if (c == EOS)
break;
String type = parseWord();
if (type.equals(UNREGISTER))
unregister = true;
else if (type.equals(CREATE))
parseCreate(createClasses);
else
throw syntax("Unrecognized keyword " + type);
}
return new Access(true, unregister, createClasses);
}
private void parseCreate(List<String> createClasses) {
while (true) {
skipSpace();
createClasses.add(parseClassName());
skipSpace();
if (c == ',')
next();
else
break;
}
}
private String parseClassName() {
// We don't check that classname components begin with suitable
// characters (so we accept 1.2.3 for example). This means that
// there are only two states, which we can call dotOK and !dotOK
// according as a dot (.) is legal or not. Initially we're in
// !dotOK since a classname can't start with a dot; after a dot
// we're in !dotOK again; and after any other characters we're in
// dotOK. The classname is only accepted if we end in dotOK,
// so we reject an empty name or a name that ends with a dot.
final int start = i;
boolean dotOK = false;
while (true) {
if (c == '.') {
if (!dotOK)
throw syntax("Bad . in class name");
dotOK = false;
} else if (c == '*' || Character.isJavaIdentifierPart(c))
dotOK = true;
else
break;
next();
}
String className = s.substring(start, i);
if (!dotOK)
throw syntax("Bad class name " + className);
return className;
}
// Advance c and i to the next character, unless already at EOS.
private void next() {
if (c != EOS) {
i += Character.charCount(c);
if (i < len)
c = s.codePointAt(i);
else
c = EOS;
}
}
private void skipSpace() {
while (Character.isWhitespace(c))
next();
} }
private void checkValues(Properties props) { private String parseWord() {
Collection<?> c = props.values(); skipSpace();
for (Iterator<?> i = c.iterator(); i.hasNext(); ) { if (c == EOS)
final String accessLevel = (String) i.next(); throw syntax("Expected word at end of line");
if (!accessLevel.equals(READONLY) && final int start = i;
!accessLevel.equals(READWRITE)) { while (c != EOS && !Character.isWhitespace(c))
throw new IllegalArgumentException( next();
"Syntax error in access level entry [" + accessLevel + "]"); String word = s.substring(start, i);
skipSpace();
return word;
} }
private IllegalArgumentException syntax(String msg) {
return new IllegalArgumentException(
msg + " [" + identity + " " + s + "]");
} }
} }
private Properties props; private Map<String, Access> accessMap;
private Properties originalProps; private Properties originalProps;
private String accessFileName; private String accessFileName;
} }
...@@ -302,7 +302,16 @@ final public class LdapCtx extends ComponentDirContext ...@@ -302,7 +302,16 @@ final public class LdapCtx extends ComponentDirContext
schemaTrees = new Hashtable(11, 0.75f); schemaTrees = new Hashtable(11, 0.75f);
initEnv(); initEnv();
try {
connect(false); connect(false);
} catch (NamingException e) {
try {
close();
} catch (Exception e2) {
// Nothing
}
throw e;
}
} }
LdapCtx(LdapCtx existing, String newDN) throws NamingException { LdapCtx(LdapCtx existing, String newDN) throws NamingException {
......
/* /*
* Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -33,12 +33,33 @@ import java.security.PrivilegedAction; ...@@ -33,12 +33,33 @@ import java.security.PrivilegedAction;
final class VersionHelper12 extends VersionHelper { final class VersionHelper12 extends VersionHelper {
// System property to control whether classes may be loaded from an
// arbitrary URL code base.
private static final String TRUST_URL_CODEBASE_PROPERTY =
"com.sun.jndi.ldap.object.trustURLCodebase";
// Determine whether classes may be loaded from an arbitrary URL code base.
private static final String trustURLCodebase =
AccessController.doPrivileged(
new PrivilegedAction<String>() {
public String run() {
return System.getProperty(TRUST_URL_CODEBASE_PROPERTY,
"false");
}
}
);
VersionHelper12() {} // Disallow external from creating one of these. VersionHelper12() {} // Disallow external from creating one of these.
ClassLoader getURLClassLoader(String[] url) ClassLoader getURLClassLoader(String[] url)
throws MalformedURLException { throws MalformedURLException {
ClassLoader parent = getContextClassLoader(); ClassLoader parent = getContextClassLoader();
if (url != null) { /*
* Classes may only be loaded from an arbitrary URL code base when
* the system property com.sun.jndi.ldap.object.trustURLCodebase
* has been set to "true".
*/
if (url != null && "true".equalsIgnoreCase(trustURLCodebase)) {
return URLClassLoader.newInstance(getUrlArray(url), parent); return URLClassLoader.newInstance(getUrlArray(url), parent);
} else { } else {
return parent; return parent;
......
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.nio.sctp;
/**
* A skeletal handler that consumes notifications and continues.
*
* <P> This class trivially implements the {@code handleNotification} methods to
* return {@link HandlerResult#CONTINUE CONTINUE} so that all notifications are
* consumed and the channel continues to try and receive a message.
*
* <P> It also provides overloaded versions of the {@code handleNotification}
* methods, one for each of the required supported notification types, {@link
* AssociationChangeNotification}, {@link PeerAddressChangeNotification},
* {@link SendFailedNotification}, and {@link ShutdownNotification}. The
* appropriate method will be invoked when the notification is received.
*
* @since 1.7
*/
public class AbstractNotificationHandler<T>
implements NotificationHandler<T>
{
/**
* Initializes a new instance of this class.
*/
protected AbstractNotificationHandler() {}
/**
* Invoked when an implementation specific notification is received from the
* SCTP stack.
*
* @param notification
* The notification
*
* @param attachment
* The object attached to the {@code receive} operation when it was
* initiated.
*
* @return The handler result
*/
@Override
public HandlerResult handleNotification(Notification notification,
T attachment) {
return HandlerResult.CONTINUE;
}
/**
* Invoked when an {@link AssociationChangeNotification} is received from
* the SCTP stack.
*
* @param notification
* The notification
*
* @param attachment
* The object attached to the {@code receive} operation when it was
* initiated.
*
* @return The handler result
*/
public HandlerResult handleNotification(AssociationChangeNotification notification,
T attachment) {
return HandlerResult.CONTINUE;
}
/**
* Invoked when an {@link PeerAddressChangeNotification} is received from
* the SCTP stack.
*
* @param notification
* The notification
*
* @param attachment
* The object attached to the {@code receive} operation when it was
* initiated.
*
* @return The handler result
*/
public HandlerResult handleNotification(PeerAddressChangeNotification notification,
T attachment) {
return HandlerResult.CONTINUE;
}
/**
* Invoked when an {@link SendFailedNotification} is received from
* the SCTP stack.
*
* @param notification
* The notification
*
* @param attachment
* The object attached to the {@code receive} operation when it was
* initiated.
*
* @return The handler result
*/
public HandlerResult handleNotification(SendFailedNotification notification,
T attachment) {
return HandlerResult.CONTINUE;
}
/**
* Invoked when an {@link ShutdownNotification} is received from
* the SCTP stack.
*
* @param notification
* The notification
*
* @param attachment
* The object attached to the {@code receive} operation when it was
* initiated.
*
* @return The handler result
*/
public HandlerResult handleNotification(ShutdownNotification notification,
T attachment) {
return HandlerResult.CONTINUE;
}
}
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.nio.sctp;
/**
* A class that represents an SCTP association.
*
* <P> An association exists between two SCTP endpoints. Each endpoint is
* represented by a list of transport addresses through which that endpoint can
* be reached and from which it will originate SCTP messages. The association
* spans over all of the possible source/destination combinations which may be
* generated from each endpoint's lists of addresses.
*
* <P> Associations are identified by their Association ID.
* Association ID's are guaranteed to be unique for the lifetime of the
* association. An association ID may be reused after the association has been
* shutdown. An association ID is not unique across multiple SCTP channels.
* An Association's local and remote addresses may change if the SCTP
* implementation supports <I>Dynamic Address Reconfiguration</I> as defined by
* <A HREF="http://tools.ietf.org/html/rfc5061">RFC5061</A>, see the
* {@code bindAddress} and {@code unbindAddress} methods of {@link SctpChannel},
* {@link SctpServerChannel}, and {@link SctpMultiChannel}.
*
* <P> An {@code Association} is returned from an {@link
* SctpChannel#association SctpChannel} or an {@link
* SctpMultiChannel#associations SctpMultiChannel}, as well
* as being given as a parameter to {@link NotificationHandler
* NotificationHandler} methods.
*
* @since 1.7
*/
public class Association {
private final int associationID;
private final int maxInStreams;
private final int maxOutStreams;
/**
* Initializes a new instance of this class.
*/
protected Association(int associationID,
int maxInStreams,
int maxOutStreams) {
this.associationID = associationID;
this.maxInStreams = maxInStreams;
this.maxOutStreams = maxOutStreams;
}
/**
* Returns the associationID.
*
* @return The association ID
*/
public final int associationID() {
return associationID;
};
/**
* Returns the maximum number of inbound streams that this association
* supports.
*
* <P> Data received on this association will be on stream number
* {@code s}, where {@code 0 <= s < maxInboundStreams()}.
*
* @return The maximum number of inbound streams
*/
public final int maxInboundStreams() {
return maxInStreams;
};
/**
* Returns the maximum number of outbound streams that this association
* supports.
*
* <P> Data sent on this association must be on stream number
* {@code s}, where {@code 0 <= s < maxOutboundStreams()}.
*
* @return The maximum number of outbound streams
*/
public final int maxOutboundStreams() {
return maxOutStreams;
};
}
/* /*
* Portions Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -22,59 +22,71 @@ ...@@ -22,59 +22,71 @@
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*/ */
package com.sun.nio.sctp;
/* /**
******************************************************************************* * Notification emitted when an association has either opened or closed.
* (C) Copyright IBM Corp. 1996-2005 - All Rights Reserved * *
* * * @since 1.7
* The original version of this source code and documentation is copyrighted * */
* and owned by IBM, These materials are provided under terms of a License * public abstract class AssociationChangeNotification
* Agreement between IBM and Sun. This technology is protected by multiple * implements Notification
* US and International patents. This notice and attribution to IBM may not * {
* to removed. * /**
******************************************************************************* * Defines the type of change event that happened to the association.
*
* @since 1.7
*/ */
public enum AssocChangeEvent
{
/**
* A new association is now ready and data may be exchanged with this peer.
*/
COMM_UP,
package sun.text.normalizer; /**
* The association has failed. A series of SCTP send failed notifications
* will follow this notification, one for each outstanding message.
*/
COMM_LOST,
/** /**
* <p>Selection constants for Unicode properties. </p> * SCTP has detected that the peer has restarted.
* <p>These constants are used in functions like
* UCharacter.hasBinaryProperty(int) to select one of the Unicode properties.
* </p>
* <p>The properties APIs are intended to reflect Unicode properties as
* defined in the Unicode Character Database (UCD) and Unicode Technical
* Reports (UTR).</p>
* <p>For details about the properties see <a href=http://www.unicode.org>
* http://www.unicode.org</a>.</p>
* <p>For names of Unicode properties see the UCD file PropertyAliases.txt.
* </p>
* <p>Important: If ICU is built with UCD files from Unicode versions below
* 3.2, then properties marked with "new" are not or not fully
* available. Check UCharacter.getUnicodeVersion() to be sure.</p>
* @author Syn Wee Quek
* @stable ICU 2.6
* @see com.ibm.icu.lang.UCharacter
*/ */
public interface UProperty RESTART,
{
// public data member -------------------------------------------------- /**
* The association has gracefully closed.
*/
SHUTDOWN,
/**
* The association failed to setup. If a message was sent on a {@link
* SctpMultiChannel} in non-blocking mode, an
* SCTP send failed notification will follow this notification for the
* outstanding message.
*/
CANT_START
}
/**
* Initializes a new instance of this class.
*/
protected AssociationChangeNotification() {}
/** /**
* Enumerated property Hangul_Syllable_Type, new in Unicode 4. * Returns the association that this notification is applicable to.
* Returns HangulSyllableType values. *
* @stable ICU 2.6 * @return The association whose state has changed, or {@code null} if
* there is no association, that is {@linkplain
* AssocChangeEvent#CANT_START CANT_START}
*/ */
public static final int HANGUL_SYLLABLE_TYPE = 0x100B; public abstract Association association();
/** /**
* Bitmask property General_Category_Mask. * Returns the type of change event.
* This is the General_Category property returned as a bit mask. *
* When used in UCharacter.getIntPropertyValue(c), * @return The event
* returns bit masks for UCharacterCategory values where exactly one bit is set.
* When used with UCharacter.getPropertyValueName() and UCharacter.getPropertyValueEnum(),
* a multi-bit mask is used for sets of categories like "Letters".
* @stable ICU 2.4
*/ */
public static final int GENERAL_CATEGORY_MASK = 0x2000; public abstract AssocChangeEvent event();
} }
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.nio.sctp;
/**
* Defines notification handler results.
*
* <P> The {@code HandlerResult} is used to determine the behavior of the
* channel after it handles a notification from the SCTP stack. Essentially its
* value determines if the channel should try to receive another notificaiton or
* a message before returning.
*
* @since 1.7
*/
public enum HandlerResult {
/**
* Try to receieve another message or notification.
*/
CONTINUE,
/**
* Return without trying to receive any more data.
*/
RETURN;
}
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.nio.sctp;
/**
* Unchecked exception thrown when an attempt is made to invoke the
* {@code receive} method of {@link SctpChannel} or {@link SctpMultiChannel}
* from a notification handler.
*
* @since 1.7
*/
public class IllegalReceiveException extends IllegalStateException {
private static final long serialVersionUID = 2296619040988576224L;
/**
* Constructs an instance of this class.
*/
public IllegalReceiveException() { }
/**
* Constructs an instance of this class with the specified message.
*/
public IllegalReceiveException(String msg) {
super(msg);
}
}
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.nio.sctp;
/**
* Unchecked exception thrown when an attempt is made to remove an
* address that is not bound to the channel, or remove an address from a
* channel that has only one address bound to it.
*
* @since 1.7
*/
public class IllegalUnbindException extends IllegalStateException {
private static final long serialVersionUID = -310540883995532224L;
/**
* Constructs an instance of this class.
*/
public IllegalUnbindException() { }
/**
* Constructs an instance of this class with the specified detailed message.
*/
public IllegalUnbindException(String msg) {
super(msg);
}
}
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.nio.sctp;
/**
* Unchecked exception thrown when an attempt is made to send a
* message to an invalid stream.
*
* @since 1.7
*/
public class InvalidStreamException extends IllegalArgumentException {
private static final long serialVersionUID = -9172703378046665558L;
/**
* Constructs an instance of this class.
*/
public InvalidStreamException() { }
/**
* Constructs an instance of this class with the specified detailed message.
*/
public InvalidStreamException(String msg) {
super(msg);
}
}
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.nio.sctp;
import java.net.SocketAddress;
/**
* The {@code MessageInfo} class provides additional ancillary information about
* messages.
*
* <P> Received SCTP messages, returned by
* {@link SctpChannel#receive SctpChannel.receive} and {@link
* SctpMultiChannel#receive SctpMultiChannel.receive},
* return a {@code MessageInfo} instance that can be queried to determine
* ancillary information about the received message. Messages being sent should
* use one of the {@link #createOutgoing(java.net.SocketAddress,int)
* createOutgoing} methods to provide ancillary data for the message being
* sent, and may use the appropriate setter methods to override the default
* values provided for {@link #isUnordered() unordered}, {@link #timeToLive()
* timeToLive}, {@link #isComplete() complete} and {@link #payloadProtocolID()
* payloadProtocolID}, before sending the message.
*
* <P> For out going messages the {@code timeToLive} parameter is a time period
* that the sending side SCTP stack may expire the message if it has not been
* sent. This time period is an indication to the stack that the message is no
* longer required to be sent after the time period expires. It is not a hard
* timeout and may be influenced by whether the association supports the partial
* reliability extension, <a href=http://www.ietf.org/rfc/rfc3758.txt>RFC 3758
* <a>
*
* <P> {@code MessageInfo} instances are not safe for use by multiple concurrent
* threads. If a MessageInfo is to be used by more than one thread then access
* to the MessageInfo should be controlled by appropriate synchronization.
*
* @since 1.7
*/
public abstract class MessageInfo {
/**
* Initializes a new instance of this class.
*/
protected MessageInfo() {}
/**
* Creates a {@code MessageInfo} instance suitable for use when
* sending a message.
*
* <P> The returned instance will have its {@link #isUnordered() unordered}
* value set to {@code false}, its {@link #timeToLive() timeToLive} value
* set to {@code 0}, its {@link #isComplete() complete} value set
* to {@code true}, and its {@link #payloadProtocolID() payloadProtocolID}
* value set to {@code 0}. These values, if required, can be set through
* the appropriate setter method before sending the message.
*
* @param address
* For a connected {@code SctpChannel} the address is the
* preferred peer address of the association to send the message
* to, or {@code null} to use the peer primary address. For an
* {@code SctpMultiChannel} the address is used to determine
* the association, or if no association exists with a peer of that
* address then one is setup.
*
* @param streamNumber
* The stream number that the message will be sent on
*
* @return The outgoing message info
*
* @throws IllegalArgumentException
* If the streamNumber is negative or greater than {@code 65536}
*/
public static MessageInfo createOutgoing(SocketAddress address,
int streamNumber) {
if (streamNumber < 0 || streamNumber > 65536)
throw new IllegalArgumentException("Invalid stream number");
return new sun.nio.ch.SctpMessageInfoImpl(null, address, streamNumber);
}
/**
* Creates a {@code MessageInfo} instance suitable for use when
* sending a message to a given association. Typically used for
* {@code SctpMultiChannel} when an association has already been setup.
*
* <P> The returned instance will have its {@link #isUnordered() unordered}
* value set to {@code false}, its {@link #timeToLive() timeToLive} value
* set to {@code 0}, its {@link #isComplete() complete} value set
* to {@code true}, and its {@link #payloadProtocolID() payloadProtocolID}
* value set to {@code 0}. These values, if required, can be set through
* the appropriate setter method before sending the message.
*
* @param association
* The association to send the message on
*
* @param address
* The preferred peer address of the association to send the message
* to, or {@code null} to use the peer primary address
*
* @param streamNumber
* The stream number that the message will be sent on.
*
* @return The outgoing message info
*
* @throws IllegalArgumentException
* If {@code association} is {@code null}, or the streamNumber is
* negative or greater than {@code 65536}
*/
public static MessageInfo createOutgoing(Association association,
SocketAddress address,
int streamNumber) {
if (association == null)
throw new IllegalArgumentException("association cannot be null");
if (streamNumber < 0 || streamNumber > 65536)
throw new IllegalArgumentException("Invalid stream number");
return new sun.nio.ch.SctpMessageInfoImpl(association, address,
streamNumber);
}
/**
* Returns the source socket address if the message has been received,
* otherwise the preferred destination of the message to be sent.
*
* @return The socket address, or {@code null} if this instance is to be
* used for sending a message and has been construced without
* specifying a preferred destination address
*
*/
public abstract SocketAddress address();
/**
* Returns the association that the message was received on, if the message
* has been received, otherwise the association that the message is to be
* sent on.
*
* @return The association, or {@code null} if this instance is to be
* used for sending a message and has been construced using the
* the {@link #createOutgoing(SocketAddress,int)
* createOutgoing(SocketAddress,int)} static factory method
*/
public abstract Association association();
/**
* Returns the number of bytes read for the received message.
*
* <P> This method is only appicable for received messages, it has no
* meaning for messages being sent.
*
* @return The number of bytes read, {@code -1} if the channel is an {@link
* SctpChannel} that has reached end-of-stream, otherwise
* {@code 0}
*/
public abstract int bytes();
/**
* Tells whether or not the message is complete.
*
* <P> For received messages {@code true} indicates that the message was
* completely received. For messages being sent {@code true} indicates that
* the message is complete, {@code false} indicates that the message is not
* complete. How the send channel interprets this value depends on the value
* of its {@link SctpStandardSocketOption#SCTP_EXPLICIT_COMPLETE
* SCTP_EXPLICIT_COMPLETE} socket option.
*
* @return {@code true} if, and only if, the message is complete
*/
public abstract boolean isComplete();
/**
* Sets whether or not the message is complete.
*
* <P> For messages being sent {@code true} indicates that
* the message is complete, {@code false} indicates that the message is not
* complete. How the send channel interprets this value depends on the value
* of its {@link SctpStandardSocketOption#SCTP_EXPLICIT_COMPLETE
* SCTP_EXPLICIT_COMPLETE} socket option.
*
* @param complete
* {@code true} if, and only if, the message is complete
*
* @return This MessageInfo
*
* @see MessageInfo#isComplete()
*/
public abstract MessageInfo complete(boolean complete);
/**
* Tells whether or not the message is unordered. For received messages
* {@code true} indicates that the message was sent non-ordered. For
* messages being sent {@code true} requests the un-ordered delivery of the
* message, {@code false} indicates that the message is ordered.
*
* @return {@code true} if the message is unordered, otherwise
* {@code false}
*/
public abstract boolean isUnordered();
/**
* Sets whether or not the message is unordered.
*
* @param unordered
* {@code true} requests the un-ordered delivery of the message,
* {@code false} indicates that the message is ordered.
*
* @return This MessageInfo
*
* @see MessageInfo#isUnordered()
*/
public abstract MessageInfo unordered(boolean unordered);
/**
* Returns the payload protocol Identifier.
*
* <P> A value indicating the type of payload protocol data being
* transmitted/received. This value is passed as opaque data by SCTP.
* {@code 0} indicates an unspecified payload protocol identifier.
*
* @return The Payload Protocol Identifier
*/
public abstract int payloadProtocolID();
/**
* Sets the payload protocol Identifier.
*
* <P> A value indicating the type of payload protocol data being
* transmitted. This value is passed as opaque data by SCTP.
*
* @param ppid
* The Payload Protocol Identifier, or {@code 0} indicate an
* unspecified payload protocol identifier.
*
* @return This MessageInfo
*
* @see MessageInfo#payloadProtocolID()
*/
public abstract MessageInfo payloadProtocolID(int ppid);
/**
* Returns the stream number that the message was received on, if the
* message has been received, otherwise the stream number that the message
* is to be sent on.
*
* @return The stream number
*/
public abstract int streamNumber();
/**
* Sets the stream number that the message is to be sent on.
*
* @param streamNumber
* The stream number
*
* @throws IllegalArgumentException
* If the streamNumber is negative or greater than {@code 65536}
*
* @return This MessageInfo
*/
public abstract MessageInfo streamNumber(int streamNumber);
/**
* The time period that the sending side may expire the message if it has
* not been sent, or {@code 0} to indicate that no timeout should occur. This
* value is only applicable for messages being sent, it has no meaning for
* received messages.
*
* @return The time period in milliseconds, or {@code 0}
*/
public abstract long timeToLive();
/**
* Sets the time period that the sending side may expire the message if it
* has not been sent.
*
* @param millis
* The time period in milliseconds, or {@code 0} to indicate that no
* timeout should occur
*
* @return This MessageInfo
*
* @see MessageInfo#timeToLive()
*/
public abstract MessageInfo timeToLive(long millis);
}
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.nio.sctp;
/**
* A notification from the SCTP stack.
*
* <P> Objects of this type are passed to the {@link NotificationHandler} when
* a notification is received.
*
* <P> An SCTP channel supports the following notifications: {@link
* AssociationChangeNotification}, {@link PeerAddressChangeNotification},
* {@link SendFailedNotification}, {@link ShutdownNotification}, and may support
* additional implementation specific notifications.
*
* @since 1.7
*/
public interface Notification {
/**
* Returns the association that this notification is applicable to.
*/
public Association association();
}
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.nio.sctp;
/**
* A handler for consuming notifications from the SCTP stack.
*
* <P> The SCTP channels defined in this package allow a notification handler to
* be specified to consume notifications from the SCTP stack. When a
* notification is received the {@linkplain #handleNotification
* handleNotification} method of the handler is invoked to handle that
* notification.
*
* <P> Additionally, an attachment object can be attached to the {@code receive}
* operation to provide context when consuming the notification. The
* attachment is important for cases where a <i>state-less</i> {@code
* NotificationHandler} is used to consume the result of many {@code receive}
* operations.
*
* <P> Handler implementations are encouraged to extend the {@link
* AbstractNotificationHandler} class which implements this interface and
* provide notification specific methods. However, an API should generally use
* this handler interface as the type for parameters, return type, etc. rather
* than the abstract class.
*
* @param T The type of the object attached to the receive operation
*
* @since 1.7
*/
public interface NotificationHandler<T> {
/**
* Invoked when a notification is received from the SCTP stack.
*
* @param notification
* The notification
*
* @param attachment
* The object attached to the receive operation when it was initiated.
*
* @return The handler result
*/
HandlerResult handleNotification(Notification notification, T attachment);
}
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.nio.sctp;
import java.net.SocketAddress;
/**
* Notification emitted when a destination address on a multi-homed peer
* encounters a change.
*
* @since 1.7
*/
public abstract class PeerAddressChangeNotification
implements Notification
{
/**
* Defines the type of address change event that occurred to the destination
* address on a multi-homed peer when it encounters a change of interface
* details.
*
* <P> Some of these events types are only generated when the association
* supports dynamic address reconfiguration, e.g. {@code SCTP_ADDR_ADDED},
* {@code SCTP_ADDR_REMOVED}, etc.
*
* @since 1.7
*/
public enum AddressChangeEvent {
/**
* This address is now reachable.
*/
ADDR_AVAILABLE,
/**
* The address specified can no longer be reached. Any data sent to this
* address is rerouted to an alternate until this address becomes reachable.
*/
ADDR_UNREACHABLE,
/**
* The address is no longer part of the association.
*/
ADDR_REMOVED,
/**
* The address is now part of the association.
*/
ADDR_ADDED,
/**
* This address has now been made to be the primary destination address.
*/
ADDR_MADE_PRIMARY,
/**
* This address has now been confirmed as a valid address.
*/
ADDR_CONFIRMED;
}
/**
* Initializes a new instance of this class.
*/
protected PeerAddressChangeNotification() {}
/**
* Returns the peer address.
*
* @return The peer address
*/
public abstract SocketAddress address();
/**
* Returns the association that this notification is applicable to.
*
* @return The association whose peer address changed
*/
public abstract Association association();
/**
* Returns the type of change event.
*
* @return The event
*/
public abstract AddressChangeEvent event();
}
此差异已折叠。
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.nio.sctp;
import java.net.SocketAddress;
import java.net.InetAddress;
import java.io.IOException;
import java.util.Set;
import java.nio.channels.SelectionKey;
import java.nio.channels.spi.SelectorProvider;
import java.nio.channels.spi.AbstractSelectableChannel;
/**
* A selectable channel for message-oriented listening SCTP sockets.
*
* <p> An {@code SCTPServerChannel} is created by invoking the
* {@link #open open} method of this class. A newly-created SCTP server
* channel is open but not yet bound. An attempt to invoke the
* {@link #accept accept} method of an unbound channel will cause the
* {@link java.nio.channels.NotYetBoundException} to be thrown. An SCTP server
* channel can be bound by invoking one of the
* {@link #bind(java.net.SocketAddress,int) bind} methods defined by this class.
*
* <p> Socket options are configured using the
* {@link #setOption(SctpSocketOption,Object) setOption} method. SCTP server socket
* channels support the following options:
* <blockquote>
* <table border>
* <tr>
* <th>Option Name</th>
* <th>Description</th>
* </tr>
* <tr>
* <td> {@link SctpStandardSocketOption#SCTP_INIT_MAXSTREAMS
* SCTP_INIT_MAXSTREAMS} </td>
* <td> The maximum number of streams requested by the local endpoint during
* association initialization </td>
* </tr>
* </table>
* </blockquote>
* Additional (implementation specific) options may also be supported. The list
* of options supported is obtained by invoking the {@link #supportedOptions()
* supportedOptions} method.
*
* <p>SCTP server channels are safe for use by multiple concurrent threads.
*
* @since 1.7
*/
public abstract class SctpServerChannel
extends AbstractSelectableChannel
{
/**
* Initializes a new instance of this class.
*
* @param provider
* The selector provider for this channel
*/
protected SctpServerChannel(SelectorProvider provider) {
super(provider);
}
/**
* Opens an SCTP server channel.
*
* <P> The new channel's socket is initially unbound; it must be bound
* to a specific address via one of its socket's {@link #bind bind}
* methods before associations can be accepted.
*
* @return A new SCTP server channel
*
* @throws UnsupportedOperationException
* If the SCTP protocol is not supported
*
* @throws IOException
* If an I/O error occurs
*/
public static SctpServerChannel open() throws
IOException {
return new sun.nio.ch.SctpServerChannelImpl((SelectorProvider)null);
}
/**
* Accepts an association on this channel's socket.
*
* <P> If this channel is in non-blocking mode then this method will
* immediately return {@code null} if there are no pending associations.
* Otherwise it will block indefinitely until a new association is
* available or an I/O error occurs.
*
* <P> The {@code SCTPChannel} returned by this method, if any, will be in
* blocking mode regardless of the blocking mode of this channel.
*
* <P> If a security manager has been installed then for each new
* association this method verifies that the address and port number of the
* assocaitions's remote peer are permitted by the security manager's {@link
* java.lang.SecurityManager#checkAccept(String,int) checkAccept} method.
*
* @return The SCTP channel for the new association, or {@code null}
* if this channel is in non-blocking mode and no association is
* available to be accepted
*
* @throws java.nio.channels.ClosedChannelException
* If this channel is closed
*
* @throws java.nio.channels.AsynchronousCloseException
* If another thread closes this channel
* while the accept operation is in progress
*
* @throws java.nio.channels.ClosedByInterruptException
* If another thread interrupts the current thread
* while the accept operation is in progress, thereby
* closing the channel and setting the current thread's
* interrupt status
*
* @throws java.nio.channels.NotYetBoundException
* If this channel's socket has not yet been bound
*
* @throws SecurityException
* If a security manager has been installed and it does not permit
* access to the remote peer of the new association
*
* @throws IOException
* If some other I/O error occurs
*/
public abstract SctpChannel accept() throws IOException;
/**
* Binds the channel's socket to a local address and configures the socket
* to listen for associations.
*
* <P> This method works as if invoking it were equivalent to evaluating the
* expression:
* <blockquote><pre>
* bind(local, 0);
* </pre></blockquote>
*
* @param local
* The local address to bind the socket, or {@code null} to
* bind the socket to an automatically assigned socket address
*
* @return This channel
*
* @throws java.nio.channels.ClosedChannelException
* If this channel is closed
*
* @throws java.nio.channels.AlreadyBoundException
* If this channel is already bound
*
* @throws java.nio.channels.UnsupportedAddressTypeException
* If the type of the given address is not supported
*
* @throws SecurityException
* If a security manager has been installed and its {@link
* java.lang.SecurityManager#checkListen(int) checkListen} method
* denies the operation
*
* @throws IOException
* If some other I/O error occurs
*/
public final SctpServerChannel bind(SocketAddress local)
throws IOException {
return bind(local, 0);
}
/**
* Binds the channel's socket to a local address and configures the socket
* to listen for associations.
*
* <P> This method is used to establish a relationship between the socket
* and the local address. Once a relationship is established then
* the socket remains bound until the channel is closed. This relationship
* may not necesssarily be with the address {@code local} as it may be
* removed by {@link #unbindAddress unbindAddress}, but there will always be
* at least one local address bound to the channel's socket once an
* invocation of this method successfully completes.
*
* <P> Once the channel's socket has been successfully bound to a specific
* address, that is not automatically assigned, more addresses
* may be bound to it using {@link #bindAddress bindAddress}, or removed
* using {@link #unbindAddress unbindAddress}.
*
* <P> The backlog parameter is the maximum number of pending associations
* on the socket. Its exact semantics are implementation specific. An
* implementation may impose an implementation specific maximum length or
* may choose to ignore the parameter. If the backlog parameter has the
* value {@code 0}, or a negative value, then an implementation specific
* default is used.
*
* @param local
* The local address to bind the socket, or {@code null} to
* bind the socket to an automatically assigned socket address
*
* @param backlog
* The maximum number number of pending associations
*
* @return This channel
*
* @throws java.nio.channels.ClosedChannelException
* If this channel is closed
*
* @throws java.nio.channels.AlreadyBoundException
* If this channel is already bound
*
* @throws java.nio.channels.UnsupportedAddressTypeException
* If the type of the given address is not supported
*
* @throws SecurityException
* If a security manager has been installed and its {@link
* java.lang.SecurityManager#checkListen(int) checkListen} method
* denies the operation
*
* @throws IOException
* If some other I/O error occurs
*/
public abstract SctpServerChannel bind(SocketAddress local,
int backlog)
throws IOException;
/**
* Adds the given address to the bound addresses for the channel's
* socket.
*
* <P> The given address must not be the {@link
* java.net.InetAddress#isAnyLocalAddress wildcard} address.
* The channel must be first bound using {@link #bind bind} before
* invoking this method, otherwise {@link
* java.nio.channels.NotYetBoundException} is thrown. The {@link #bind bind}
* method takes a {@code SocketAddress} as its argument which typically
* contains a port number as well as an address. Addresses subquently bound
* using this method are simply addresses as the SCTP port number remains
* the same for the lifetime of the channel.
*
* <P> New associations accepted after this method successfully completes
* will be associated with the given address.
*
* @param address
* The address to add to the bound addresses for the socket
*
* @return This channel
*
* @throws java.nio.channels.ClosedChannelException
* If this channel is closed
*
* @throws java.nio.channels.NotYetBoundException
* If this channel is not yet bound
*
* @throws java.nio.channels.AlreadyBoundException
* If this channel is already bound to the given address
*
* @throws IllegalArgumentException
* If address is {@code null} or the {@link
* java.net.InetAddress#isAnyLocalAddress wildcard} address
*
* @throws IOException
* If some other I/O error occurs
*/
public abstract SctpServerChannel bindAddress(InetAddress address)
throws IOException;
/**
* Removes the given address from the bound addresses for the channel's
* socket.
*
* <P> The given address must not be the {@link
* java.net.InetAddress#isAnyLocalAddress wildcard} address.
* The channel must be first bound using {@link #bind bind} before
* invoking this method, otherwise
* {@link java.nio.channels.NotYetBoundException} is thrown.
* If this method is invoked on a channel that does not have
* {@code address} as one of its bound addresses, or that has only one
* local address bound to it, then this method throws {@link
* IllegalUnbindException}.
* The initial address that the channel's socket is bound to using
* {@link #bind bind} may be removed from the bound addresses for the
* channel's socket.
*
* <P> New associations accepted after this method successfully completes
* will not be associated with the given address.
*
* @param address
* The address to remove from the bound addresses for the socket
*
* @return This channel
*
* @throws java.nio.channels.ClosedChannelException
* If this channel is closed
*
* @throws java.nio.channels.NotYetBoundException
* If this channel is not yet bound
*
* @throws IllegalArgumentException
* If address is {@code null} or the {@link
* java.net.InetAddress#isAnyLocalAddress wildcard} address
*
* @throws IllegalUnbindException
* If the implementation does not support removing addresses from a
* listening socket, {@code address} is not bound to the channel's
* socket, or the channel has only one address bound to it
*
* @throws IOException
* If some other I/O error occurs
*/
public abstract SctpServerChannel unbindAddress(InetAddress address)
throws IOException;
/**
* Returns all of the socket addresses to which this channel's socket is
* bound.
*
* @return All the socket addresses that this channel's socket is
* bound to, or an empty {@code Set} if the channel's socket is not
* bound
*
* @throws java.nio.channels.ClosedChannelException
* If the channel is closed
*
* @throws IOException
* If an I/O error occurs
*/
public abstract Set<SocketAddress> getAllLocalAddresses()
throws IOException;
/**
* Returns the value of a socket option.
*
* @param name
* The socket option
*
* @return The value of the socket option. A value of {@code null} may be
* a valid value for some socket options.
*
* @throws UnsupportedOperationException
* If the socket option is not supported by this channel
*
* @throws java.nio.channels.ClosedChannelException
* If this channel is closed
*
* @throws IOException
* If an I/O error occurs
*
* @see SctpStandardSocketOption
*/
public abstract <T> T getOption(SctpSocketOption<T> name) throws IOException;
/**
* Sets the value of a socket option.
*
* @param name
* The socket option
*
* @param value
* The value of the socket option. A value of {@code null} may be
* a valid value for some socket options.
*
* @return This channel
*
* @throws UnsupportedOperationException
* If the socket option is not supported by this channel
*
* @throws IllegalArgumentException
* If the value is not a valid value for this socket option
*
* @throws java.nio.channels.ClosedChannelException
* If this channel is closed
*
* @throws IOException
* If an I/O error occurs
*
* @see SctpStandardSocketOption
*/
public abstract <T> SctpServerChannel setOption(SctpSocketOption<T> name,
T value)
throws IOException;
/**
* Returns a set of the socket options supported by this channel.
*
* <P> This method will continue to return the set of options even after the
* channel has been closed.
*
* @return A set of the socket options supported by this channel
*/
public abstract Set<SctpSocketOption<?>> supportedOptions();
/**
* Returns an operation set identifying this channel's supported
* operations.
*
* <P> SCTP server channels only support the accepting of new
* associations, so this method returns
* {@link java.nio.channels.SelectionKey#OP_ACCEPT}.
*
* @return The valid-operation set
*/
@Override
public final int validOps() {
return SelectionKey.OP_ACCEPT;
}
}
/* /*
* Copyright 2001-2002 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -22,22 +22,17 @@ ...@@ -22,22 +22,17 @@
* CA 95054 USA or visit www.sun.com if you need additional information or * CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions. * have any questions.
*/ */
package com.sun.nio.sctp;
#ifndef AWT_KEYBOARDFOCUSMANAGER_H import java.net.SocketOption;
#define AWT_KEYBOARDFOCUSMANAGER_H
#include <jni.h> /**
* A socket option associated with an SCTP channel.
class AwtKeyboardFocusManager { *
public: * @param <T> The type of the socket option value.
*
static jclass keyboardFocusManagerCls; * @since 1.7
static jmethodID shouldNativelyFocusHeavyweightMID; *
static jmethodID heavyweightButtonDownMID; * @see SctpStandardSocketOption
static jmethodID markClearGlobalFocusOwnerMID; */
static jmethodID removeLastFocusRequestMID; public interface SctpSocketOption<T> extends SocketOption<T> { }
static jfieldID isProxyActive;
static jmethodID processSynchronousTransfer;
};
#endif // AWT_KEYBOARDFOCUSMANAGER_H
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.nio.sctp;
import java.nio.ByteBuffer;
import java.net.SocketAddress;
/**
* Notification emitted when a send failed notification has been received.
*
* <P> A send failed notification indicates that a message cannot be delivered.
* Typically this is because the association has been shutdown with unsent data
* in the socket output buffer, or in the case of a {@link SctpMultiChannel}
* the association failed to setup.
*
* @since 1.7
*/
public abstract class SendFailedNotification implements Notification {
/**
* Initializes a new instance of this class.
*/
protected SendFailedNotification() {}
/**
* Returns the association that this notification is applicable to.
*
* @return The association that failed to send, or {@code null} if
* there is no association, that is, the notification follows a
* {@linkplain
* com.sun.nio.sctp.AssociationChangeNotification.AssocChangeEvent#CANT_START}
*/
@Override
public abstract Association association();
/**
* Returns the address.
*
* @return The peer primary address of the association or the address that
* the message was sent to
*/
public abstract SocketAddress address();
/**
* Returns the data that was to be sent.
*
* @return The user data. The buffers position will be {@code 0} and its
* limit will be set to the end of the data.
*/
public abstract ByteBuffer buffer();
/**
* Returns the error code.
*
* <P> The errorCode gives the reason why the send failed, and if set, will
* be a SCTP protocol error code as defined in RFC2960 section 3.3.10
*
* @return The error code
*/
public abstract int errorCode();
/**
* Returns the stream number that the messge was to be sent on.
*
* @return The stream number
*/
public abstract int streamNumber();
}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册